From c5de5d4c39b53213b1ed52d800a2d5214641ee85 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 9 Nov 2016 18:53:15 +1030 Subject: [PATCH] timeout: remove absolute timers. We don't actually use them. Signed-off-by: Rusty Russell --- daemon/timeout.c | 15 +++------------ daemon/timeout.h | 9 --------- 2 files changed, 3 insertions(+), 21 deletions(-) diff --git a/daemon/timeout.c b/daemon/timeout.c index 43bd2ecbc..57624d648 100644 --- a/daemon/timeout.c +++ b/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); diff --git a/daemon/timeout.h b/daemon/timeout.h index a272e4c9d..0264d0d08 100644 --- a/daemon/timeout.h +++ b/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 */