From 4e7ba96729772328bc257cdad3e48cdb41f61e23 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 6 Feb 2025 13:17:33 +1030 Subject: [PATCH] lightningd: don't kill onchaind if we are forcing a disconnect. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We thought it was a good idea to terminate channel subds, but we included onchaind as well! ``` 2025-01-29T21:31:46.053Z UNUSUAL 03…00-channeld-chan#255683: Adding HTLC 1737 too slow: killing connection 2025-01-29T21:31:46.053Z INFO 03…00-chan#255683: Peer transient failure in CHANNELD_NORMAL: Adding HTLC timed out: killed connection 2025-01-29T21:31:46.053Z DEBUG 03…00-channeld-chan#255683: Status closed, but not exited. Killing 2025-01-29T21:31:46.054Z DEBUG 03…00-chan#255683: Failing HTLC 1738 due to peer death 2025-01-29T21:31:46.058Z DEBUG 03…00-chan#255683: Failing HTLC 1737 due to peer death 2025-01-29T21:31:46.058Z DEBUG 03…00-chan#255673: Forcing disconnect due to One channel had an error 2025-01-29T21:31:46.059Z DEBUG 03…00-onchaind-chan#255673: Status closed, but not exited. Killing 2025-01-29T21:31:46.093Z DEBUG 03…00-connectd: disconnect_peer 2025-01-29T21:31:46.093Z DEBUG 03…00-lightningd: peer_disconnect_done ``` Reported-by: @whitslack Fixes: https://github.com/ElementsProject/lightning/issues/8055 Changelog-Fixed: onchaind: don't die if we fail an unrelated channel with the same peer. Signed-off-by: Rusty Russell --- lightningd/connect_control.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lightningd/connect_control.c b/lightningd/connect_control.c index 0403d6236..461f32ccd 100644 --- a/lightningd/connect_control.c +++ b/lightningd/connect_control.c @@ -542,6 +542,9 @@ void force_peer_disconnect(struct lightningd *ld, if (!c->owner) continue; + if (!channel_state_wants_peercomms(c->state)) + continue; + log_debug(c->log, "Forcing disconnect due to %s", why); /* This frees c! */ if (channel_state_uncommitted(c->state))