channeld: Tell gossipd when we get a shutdown message from a peer

Disabling the channel and enqueing the update for broadcast so we
don't get forwarding requests from remote peers, and we don't try to
ourselves.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
Christian Decker 2018-01-21 12:05:34 +01:00 committed by Rusty Russell
parent 6320142c34
commit 4f4b0e9bba
1 changed files with 4 additions and 1 deletions

View File

@ -1528,7 +1528,10 @@ static void handle_pong(struct peer *peer, const u8 *pong)
static void handle_peer_shutdown(struct peer *peer, const u8 *shutdown)
{
struct channel_id channel_id;
u8 *scriptpubkey;
u8 *scriptpubkey, *msg;
msg = create_channel_update(peer, peer, true);
wire_sync_write(GOSSIP_FD, take(msg));
if (!fromwire_shutdown(peer, shutdown, NULL, &channel_id, &scriptpubkey))
peer_failed(PEER_FD,