timeout: remove absolute timers.

We don't actually use them.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2016-11-09 18:53:15 +10:30
parent 3aca5c87e3
commit c5de5d4c39
2 changed files with 3 additions and 21 deletions

View file

@ -15,12 +15,13 @@ static void remove_timer(struct oneshot *t)
timer_del(&t->dstate->timers, &t->timer); timer_del(&t->dstate->timers, &t->timer);
} }
struct oneshot *new_abstimer_(struct lightningd_state *dstate, struct oneshot *new_reltimer_(struct lightningd_state *dstate,
const tal_t *ctx, const tal_t *ctx,
struct timeabs expiry, struct timerel relexpiry,
void (*cb)(void *), void *arg) void (*cb)(void *), void *arg)
{ {
struct oneshot *t = tal(ctx, struct oneshot); struct oneshot *t = tal(ctx, struct oneshot);
struct timeabs expiry = timeabs_add(controlled_time(), relexpiry);
t->cb = cb; t->cb = cb;
t->arg = arg; t->arg = arg;
@ -32,16 +33,6 @@ struct oneshot *new_abstimer_(struct lightningd_state *dstate,
return t; return t;
} }
struct oneshot *new_reltimer_(struct lightningd_state *dstate,
const tal_t *ctx,
struct timerel relexpiry,
void (*cb)(void *), void *arg)
{
return new_abstimer_(dstate, ctx,
timeabs_add(controlled_time(), relexpiry),
cb, arg);
}
void timer_expired(struct lightningd_state *dstate, struct timer *timer) void timer_expired(struct lightningd_state *dstate, struct timer *timer)
{ {
struct oneshot *t = container_of(timer, struct oneshot, timer); struct oneshot *t = container_of(timer, struct oneshot, timer);

View file

@ -17,15 +17,6 @@ struct oneshot *new_reltimer_(struct lightningd_state *dstate,
new_reltimer_((dstate), (ctx), (relexpire), \ new_reltimer_((dstate), (ctx), (relexpire), \
typesafe_cb(void, void *, (func), (arg)), (arg)) typesafe_cb(void, void *, (func), (arg)), (arg))
struct oneshot *new_abstimer_(struct lightningd_state *dstate,
const tal_t *ctx,
struct timeabs expire,
void (*cb)(void *), void *arg);
#define new_abstimer(dstate, ctx, absexpire, func, arg) \
new_abstimer_((dstate), (ctx), (absexpire), \
typesafe_cb(void, void *, (func), (arg)), (arg))
void timer_expired(struct lightningd_state *dstate, struct timer *timer); void timer_expired(struct lightningd_state *dstate, struct timer *timer);
#endif /* LIGHTNING_DAEMON_TIMEOUT_H */ #endif /* LIGHTNING_DAEMON_TIMEOUT_H */