From e463386d759c7776d2aaf210d7343ca7724f14a1 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Tue, 23 Jan 2018 22:15:29 +0100 Subject: [PATCH] masterd: Disable a channel when channeld fails Signed-off-by: Christian Decker --- lightningd/peer_control.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lightningd/peer_control.c b/lightningd/peer_control.c index 172998613..f86c40385 100644 --- a/lightningd/peer_control.c +++ b/lightningd/peer_control.c @@ -186,11 +186,17 @@ void peer_fail_permanent(struct peer *peer, const char *fmt, ...) { va_list ap; char *why; + u8 *msg; va_start(ap, fmt); why = tal_vfmt(peer, fmt, ap); va_end(ap); + if (peer->scid) { + msg = towire_gossip_disable_channel(peer, peer->scid, peer->direction, false); + subd_send_msg(peer->ld->gossip, take(msg)); + } + log_unusual(peer->log, "Peer permanent failure in %s: %s", peer_state_name(peer->state), why);