Browse Source

timeout: remove absolute timers.

We don't actually use them.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ppa-0.6.1
Rusty Russell 8 years ago
parent
commit
c5de5d4c39
  1. 15
      daemon/timeout.c
  2. 9
      daemon/timeout.h

15
daemon/timeout.c

@ -15,12 +15,13 @@ static void remove_timer(struct oneshot *t)
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,
struct timeabs expiry,
struct timerel relexpiry,
void (*cb)(void *), void *arg)
{
struct oneshot *t = tal(ctx, struct oneshot);
struct timeabs expiry = timeabs_add(controlled_time(), relexpiry);
t->cb = cb;
t->arg = arg;
@ -32,16 +33,6 @@ struct oneshot *new_abstimer_(struct lightningd_state *dstate,
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)
{
struct oneshot *t = container_of(timer, struct oneshot, timer);

9
daemon/timeout.h

@ -17,15 +17,6 @@ struct oneshot *new_reltimer_(struct lightningd_state *dstate,
new_reltimer_((dstate), (ctx), (relexpire), \
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);
#endif /* LIGHTNING_DAEMON_TIMEOUT_H */

Loading…
Cancel
Save