mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 05:12:45 +01:00
timers: use time_mono, as that's what ccan/timers now wants.
Fixes: #58 Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
74d471d4e4
commit
9708c7a019
@ -351,7 +351,7 @@ static struct lightningd_state *lightningd_state(void)
|
|||||||
list_head_init(&dstate->pay_commands);
|
list_head_init(&dstate->pay_commands);
|
||||||
dstate->portnum = 0;
|
dstate->portnum = 0;
|
||||||
dstate->testnet = true;
|
dstate->testnet = true;
|
||||||
timers_init(&dstate->timers, time_now());
|
timers_init(&dstate->timers, time_mono());
|
||||||
txwatch_hash_init(&dstate->txwatches);
|
txwatch_hash_init(&dstate->txwatches);
|
||||||
txowatch_hash_init(&dstate->txowatches);
|
txowatch_hash_init(&dstate->txowatches);
|
||||||
dstate->secpctx = secp256k1_context_create(SECP256K1_CONTEXT_VERIFY
|
dstate->secpctx = secp256k1_context_create(SECP256K1_CONTEXT_VERIFY
|
||||||
|
@ -20,13 +20,12 @@ struct oneshot *new_reltimer_(struct lightningd_state *dstate,
|
|||||||
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(time_now(), relexpiry);
|
|
||||||
|
|
||||||
t->cb = cb;
|
t->cb = cb;
|
||||||
t->arg = arg;
|
t->arg = arg;
|
||||||
t->dstate = dstate;
|
t->dstate = dstate;
|
||||||
timer_init(&t->timer);
|
timer_init(&t->timer);
|
||||||
timer_add(&dstate->timers, &t->timer, expiry);
|
timer_addrel(&dstate->timers, &t->timer, relexpiry);
|
||||||
tal_add_destructor(t, remove_timer);
|
tal_add_destructor(t, remove_timer);
|
||||||
|
|
||||||
return t;
|
return t;
|
||||||
|
Loading…
Reference in New Issue
Block a user