gossip: Add message to enable and disable a channel

Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
Christian Decker
2018-01-23 22:13:19 +01:00
committed by Rusty Russell
parent d14969ce77
commit c6ae4b521f
3 changed files with 15 additions and 0 deletions

View File

@@ -1769,6 +1769,12 @@ static struct io_plan *handle_txout_reply(struct io_conn *conn,
return daemon_conn_read_next(conn, &daemon->master);
}
static struct io_plan *handle_disable_channel(struct io_conn *conn,
struct daemon *daemon, u8 *msg)
{
return daemon_conn_read_next(conn, &daemon->master);
}
static struct io_plan *recv_req(struct io_conn *conn, struct daemon_conn *master)
{
struct daemon *daemon = container_of(master, struct daemon, master);
@@ -1814,6 +1820,9 @@ static struct io_plan *recv_req(struct io_conn *conn, struct daemon_conn *master
case WIRE_GOSSIP_GET_TXOUT_REPLY:
return handle_txout_reply(conn, daemon, master->msg_in);
case WIRE_GOSSIP_DISABLE_CHANNEL:
return handle_disable_channel(conn, daemon, master->msg_in);
/* We send these, we don't receive them */
case WIRE_GOSSIPCTL_RELEASE_PEER_REPLY:
case WIRE_GOSSIPCTL_RELEASE_PEER_REPLYFAIL:

View File

@@ -183,3 +183,8 @@ gossip_get_txout_reply,,short_channel_id,struct short_channel_id
gossip_get_txout_reply,,len,u16
gossip_get_txout_reply,,outscript,len*u8
# client->gossipd: Disable the channel matching the short_channel_id
gossip_disable_channel,3019
gossip_disable_channel,,short_channel_id,struct short_channel_id
gossip_disable_channel,,direction,u8
gossip_disable_channel,,active,bool
1 #include <common/cryptomsg.h>
183
184
185
186
187
188
189
190

View File

@@ -109,6 +109,7 @@ static unsigned gossip_msg(struct subd *gossip, const u8 *msg, const int *fds)
case WIRE_GOSSIP_GET_UPDATE:
case WIRE_GOSSIP_SEND_GOSSIP:
case WIRE_GOSSIP_GET_TXOUT_REPLY:
case WIRE_GOSSIP_DISABLE_CHANNEL:
/* This is a reply, so never gets through to here. */
case WIRE_GOSSIP_GET_UPDATE_REPLY:
case WIRE_GOSSIP_GETNODES_REPLY: