diff --git a/lightningd/chaintopology.c b/lightningd/chaintopology.c index a7d5463ba..67fbb549f 100644 --- a/lightningd/chaintopology.c +++ b/lightningd/chaintopology.c @@ -47,7 +47,7 @@ static void maybe_completed_init(struct chain_topology *topo) static void next_topology_timer(struct chain_topology *topo) { /* This takes care of its own lifetime. */ - notleak(new_reltimer(topo->timers, topo, + notleak(new_reltimer(topo->ld->timers, topo, time_from_sec(topo->poll_seconds), try_extend_tip, topo)); } @@ -583,7 +583,7 @@ AUTODATA(json_command, &parse_feerate_command); static void next_updatefee_timer(struct chain_topology *topo) { /* This takes care of its own lifetime. */ - notleak(new_reltimer(topo->timers, topo, + notleak(new_reltimer(topo->ld->timers, topo, time_from_sec(topo->poll_seconds), start_fee_estimate, topo)); } @@ -1157,11 +1157,9 @@ static void retry_check_chain(struct chain_topology *topo) } void setup_topology(struct chain_topology *topo, - struct timers *timers, u32 min_blockheight, u32 max_blockheight) { memset(&topo->feerate, 0, sizeof(topo->feerate)); - topo->timers = timers; topo->min_blockheight = min_blockheight; topo->max_blockheight = max_blockheight; diff --git a/lightningd/chaintopology.h b/lightningd/chaintopology.h index 0b6a5e020..99c75c340 100644 --- a/lightningd/chaintopology.h +++ b/lightningd/chaintopology.h @@ -113,9 +113,6 @@ struct chain_topology { /* The bitcoind. */ struct bitcoind *bitcoind; - /* Our timer list. */ - struct timers *timers; - /* Bitcoin transactions we're broadcasting */ struct list_head outgoing_txs; @@ -193,7 +190,7 @@ void broadcast_tx_ahf(struct chain_topology *topo, const char *err)); struct chain_topology *new_topology(struct lightningd *ld, struct log *log); -void setup_topology(struct chain_topology *topology, struct timers *timers, +void setup_topology(struct chain_topology *topology, u32 min_blockheight, u32 max_blockheight); void begin_topology(struct chain_topology *topo); diff --git a/lightningd/lightningd.c b/lightningd/lightningd.c index 38ce1f574..126908698 100644 --- a/lightningd/lightningd.c +++ b/lightningd/lightningd.c @@ -1035,8 +1035,7 @@ int main(int argc, char *argv[]) /*~ Initialize block topology. This does its own io_loop to * talk to bitcoind, so does its own db transactions. */ - setup_topology(ld->topology, ld->timers, - min_blockheight, max_blockheight); + setup_topology(ld->topology, min_blockheight, max_blockheight); db_begin_transaction(ld->wallet->db); diff --git a/lightningd/test/run-find_my_abspath.c b/lightningd/test/run-find_my_abspath.c index 946f38e27..6fc6d46c7 100644 --- a/lightningd/test/run-find_my_abspath.c +++ b/lightningd/test/run-find_my_abspath.c @@ -202,7 +202,7 @@ void plugins_set_builtin_plugins_dir(struct plugins *plugins UNNEEDED, void setup_color_and_alias(struct lightningd *ld UNNEEDED) { fprintf(stderr, "setup_color_and_alias called!\n"); abort(); } /* Generated stub for setup_topology */ -void setup_topology(struct chain_topology *topology UNNEEDED, struct timers *timers UNNEEDED, +void setup_topology(struct chain_topology *topology UNNEEDED, u32 min_blockheight UNNEEDED, u32 max_blockheight UNNEEDED) { fprintf(stderr, "setup_topology called!\n"); abort(); } /* Generated stub for timer_expired */