diff --git a/daemon/lightningd.c b/daemon/lightningd.c index 3889083fa..996960228 100644 --- a/daemon/lightningd.c +++ b/daemon/lightningd.c @@ -351,7 +351,7 @@ static struct lightningd_state *lightningd_state(void) list_head_init(&dstate->pay_commands); dstate->portnum = 0; dstate->testnet = true; - timers_init(&dstate->timers, time_now()); + timers_init(&dstate->timers, time_mono()); txwatch_hash_init(&dstate->txwatches); txowatch_hash_init(&dstate->txowatches); dstate->secpctx = secp256k1_context_create(SECP256K1_CONTEXT_VERIFY diff --git a/daemon/timeout.c b/daemon/timeout.c index 47fe29ab1..d04ab8cae 100644 --- a/daemon/timeout.c +++ b/daemon/timeout.c @@ -20,13 +20,12 @@ struct oneshot *new_reltimer_(struct lightningd_state *dstate, void (*cb)(void *), void *arg) { struct oneshot *t = tal(ctx, struct oneshot); - struct timeabs expiry = timeabs_add(time_now(), relexpiry); t->cb = cb; t->arg = arg; t->dstate = dstate; timer_init(&t->timer); - timer_add(&dstate->timers, &t->timer, expiry); + timer_addrel(&dstate->timers, &t->timer, relexpiry); tal_add_destructor(t, remove_timer); return t;