master: Move the gossipd initialization after the other inits#1440
Conversation
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>
6ecab3b to
f50af8c
Compare
|
This revealed a new race, however; activating peer means we tried sending to gossipd before it was ready. Let's start gossipd, then explicitly tell it to activate. That also improves parallelism. |
This means gossipd is live and we can tell it things, but it won't receive incoming connections. The split also means that the main daemon continues (eg. loading peers from db) while gossipd is loading from the store, potentially speeding startup. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
|
This is supposed to fix #1437? Yes/No/Maybe? |
|
I think so, though @cdecker didn't reference a PR in the original? |
EDIT: only saw your added commit now.
It's a bug I encountered when restarting sleepyark, I didn't get a chance to go through the issue list. I'll edit the OP to include fixes markers. |
|
ACK 3c6a943 |
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).
Fixes #1437