From 4f4b0e9bba7f5663bdcd8f7a054e2a276983777a Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Sun, 21 Jan 2018 12:05:34 +0100 Subject: [PATCH] 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 --- channeld/channel.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/channeld/channel.c b/channeld/channel.c index a60f3f7b7..48984351f 100644 --- a/channeld/channel.c +++ b/channeld/channel.c @@ -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,