gossipd: remove connectd functionality, enable connectd.

This patch guts gossipd of all peer-related functionality, and hands
all the peer-related requests to channeld instead.

gossipd now gets the final announcable addresses in its init msg, since
it doesn't handle socket binding any more.

lightningd now actually starts connectd, and activates it.  The init
messages for both gossipd and connectd still contain redundant fields
which need cleaning up.

There are shims to handle the fact that connectd's wire messages are
still (mostly) gossipd messages.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2018-07-24 15:48:58 +09:30
parent 92d66a5451
commit 3d3d2ef9af
16 changed files with 249 additions and 1894 deletions

View File

@@ -208,6 +208,7 @@ static void shutdown_subdaemons(struct lightningd *ld)
db_begin_transaction(ld->wallet->db);
/* Let everyone shutdown cleanly. */
close(ld->hsm_fd);
subd_shutdown(ld->connectd, 10);
subd_shutdown(ld->gossip, 10);
subd_shutdown(ld->hsm, 10);
@@ -423,9 +424,9 @@ int main(int argc, char *argv[])
/* Create PID file */
pidfile_create(ld);
/* Activate gossip daemon. Needs to be after the initialization of
/* Activate connect daemon. Needs to be after the initialization of
* chaintopology, otherwise we may be asking for uninitialized data. */
gossip_activate(ld);
connectd_activate(ld);
/* Replay transactions for all running onchainds */
onchaind_replay_channels(ld);