Browse Source

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>
ppa-0.6.1
Christian Decker 7 years ago
parent
commit
61317859f8
  1. 7
      lightningd/lightningd.c

7
lightningd/lightningd.c

@ -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…
Cancel
Save