mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-23 15:04:19 +01:00
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:
@@ -1830,13 +1830,12 @@ static struct io_plan *recv_req(struct io_conn *conn, struct daemon_conn *master
|
||||
enum gossip_wire_type t= fromwire_peektype(master->msg_in);
|
||||
|
||||
/* FIXME: Move away from gossip wiretypes */
|
||||
if (fromwire_peektype(master->msg_in) == WIRE_CONNECTCTL_INIT)
|
||||
return gossip_init(master, daemon, master->msg_in);
|
||||
if (fromwire_peektype(master->msg_in) == WIRE_CONNECTCTL_ACTIVATE)
|
||||
return gossip_activate(master, daemon, master->msg_in);
|
||||
|
||||
switch (t) {
|
||||
case WIRE_GOSSIPCTL_INIT:
|
||||
return gossip_init(master, daemon, master->msg_in);
|
||||
|
||||
case WIRE_GOSSIPCTL_RELEASE_PEER:
|
||||
return release_peer(conn, daemon, master->msg_in);
|
||||
|
||||
@@ -1862,6 +1861,7 @@ static struct io_plan *recv_req(struct io_conn *conn, struct daemon_conn *master
|
||||
return disconnect_peer(conn, daemon, master->msg_in);
|
||||
|
||||
/* FIXME: We don't really do these, gossipd does */
|
||||
case WIRE_GOSSIPCTL_INIT:
|
||||
case WIRE_GOSSIPCTL_ACTIVATE:
|
||||
case WIRE_GOSSIP_GETNODES_REQUEST:
|
||||
case WIRE_GOSSIP_PING:
|
||||
@@ -1880,7 +1880,6 @@ static struct io_plan *recv_req(struct io_conn *conn, struct daemon_conn *master
|
||||
break;
|
||||
|
||||
/* We send these, we don't receive them */
|
||||
case WIRE_GOSSIPCTL_ACTIVATE_REPLY:
|
||||
case WIRE_GOSSIPCTL_RELEASE_PEER_REPLY:
|
||||
case WIRE_GOSSIPCTL_RELEASE_PEER_REPLYFAIL:
|
||||
case WIRE_GOSSIP_GETNODES_REPLY:
|
||||
|
||||
Reference in New Issue
Block a user