mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 05:12:45 +01:00
gossipd: don't start listening to connectd until we get init message.
This was always a theoretical race, but with the next change we actually hit it under valgrind. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
32d650f9df
commit
7b56b2b8ce
@ -1155,6 +1155,10 @@ static struct io_plan *gossip_init(struct io_conn *conn,
|
|||||||
/* Fire up the seeker! */
|
/* Fire up the seeker! */
|
||||||
daemon->seeker = new_seeker(daemon);
|
daemon->seeker = new_seeker(daemon);
|
||||||
|
|
||||||
|
/* connectd is already started, and uses this fd to ask us things. */
|
||||||
|
daemon->connectd = daemon_conn_new(daemon, CONNECTD_FD,
|
||||||
|
connectd_req, NULL, daemon);
|
||||||
|
|
||||||
return daemon_conn_read_next(conn, daemon->master);
|
return daemon_conn_read_next(conn, daemon->master);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1952,10 +1956,6 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
status_setup_async(daemon->master);
|
status_setup_async(daemon->master);
|
||||||
|
|
||||||
/* connectd is already started, and uses this fd to ask us things. */
|
|
||||||
daemon->connectd = daemon_conn_new(daemon, CONNECTD_FD,
|
|
||||||
connectd_req, NULL, daemon);
|
|
||||||
|
|
||||||
/* This loop never exits. io_loop() only returns if a timer has
|
/* This loop never exits. io_loop() only returns if a timer has
|
||||||
* expired, or io_break() is called, or all fds are closed. We don't
|
* expired, or io_break() is called, or all fds are closed. We don't
|
||||||
* use io_break and closing the lightningd fd calls master_gone()
|
* use io_break and closing the lightningd fd calls master_gone()
|
||||||
|
Loading…
Reference in New Issue
Block a user