diff --git a/gossipd/gossipd.c b/gossipd/gossipd.c index b8e6fc065..1990a53e0 100644 --- a/gossipd/gossipd.c +++ b/gossipd/gossipd.c @@ -1155,6 +1155,10 @@ static struct io_plan *gossip_init(struct io_conn *conn, /* Fire up the seeker! */ 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); } @@ -1952,10 +1956,6 @@ int main(int argc, char *argv[]) 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 * 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()