mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-01 17:47:30 +01:00
master: Move the gossipd initialization after the other inits
If we start accepting peer connections before we initialized some of the other parts (mainly the chaintopology) we could end up asking for stuff that isn't ready yet (blockchain head for example). Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
parent
91d149b990
commit
61317859f8
1 changed files with 4 additions and 3 deletions
|
@ -328,9 +328,6 @@ int main(int argc, char *argv[])
|
|||
/* Now we know our ID, we can set our color/alias if not already. */
|
||||
setup_color_and_alias(ld);
|
||||
|
||||
/* Set up gossip daemon. */
|
||||
gossip_init(ld);
|
||||
|
||||
/* Everything is within a transaction. */
|
||||
db_begin_transaction(ld->wallet->db);
|
||||
|
||||
|
@ -394,6 +391,10 @@ int main(int argc, char *argv[])
|
|||
ld->config.poll_time,
|
||||
blockheight);
|
||||
|
||||
/* Set up gossip daemon. Needs to be after the initialization of
|
||||
* chaintopology, otherwise we may be asking for uninitialized data. */
|
||||
gossip_init(ld);
|
||||
|
||||
/* Replay transactions for all running onchainds */
|
||||
onchaind_replay_channels(ld);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue