lightningd: initialize topology synclist earlier.

We were doing it in setup_topology, but that's too late if gossipd
wants to register earlier.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2019-09-22 11:35:43 +09:30
parent 3c9ca5d3e1
commit 6955bf6b86

View File

@ -944,6 +944,8 @@ struct chain_topology *new_topology(struct lightningd *ld, struct log *log)
topo->poll_seconds = 30;
topo->feerate_uninitialized = true;
topo->root = NULL;
topo->sync_waiters = tal(topo, struct list_head);
list_head_init(topo->sync_waiters);
return topo;
}
@ -953,8 +955,6 @@ void setup_topology(struct chain_topology *topo,
{
memset(&topo->feerate, 0, sizeof(topo->feerate));
topo->timers = timers;
topo->sync_waiters = tal(topo, struct list_head);
list_head_init(topo->sync_waiters);
topo->min_blockheight = min_blockheight;
topo->max_blockheight = max_blockheight;