mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-23 17:14:22 +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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user