From b85431bfef315870041689e202f73dcb4494781e Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Sun, 22 Oct 2023 14:37:32 +1030 Subject: [PATCH] lightningd: let channeld/dual_openingd send error to peer. We do it here, but it's not necessary, and we also deprive them of the chance to do so (since we kill them). Signed-off-by: Rusty Russell --- lightningd/channel_control.c | 5 ----- tests/test_connection.py | 4 ++-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/lightningd/channel_control.c b/lightningd/channel_control.c index 6725e43048f7..bfae7643e2aa 100644 --- a/lightningd/channel_control.c +++ b/lightningd/channel_control.c @@ -1059,11 +1059,6 @@ void channel_fallen_behind(struct channel *channel, const u8 *msg) fatal("Our own id invalid?"); channel->future_per_commitment_point = any; } - - /* Peer sees this, so send a generic msg about unilateral close. */ - channel_fail_permanent(channel, - REASON_LOCAL, - "Awaiting unilateral close"); } static void diff --git a/tests/test_connection.py b/tests/test_connection.py index cce0c50005dd..a884301e77d1 100644 --- a/tests/test_connection.py +++ b/tests/test_connection.py @@ -3048,7 +3048,7 @@ def test_dataloss_protection(node_factory, bitcoind): l2.start() # l2 should freak out! - l2.daemon.wait_for_log("Peer permanent failure in CHANNELD_NORMAL: Awaiting unilateral close") + l2.daemon.wait_for_log("Peer permanent failure in CHANNELD_NORMAL:.*Awaiting unilateral close") # l2 must NOT drop to chain. l2.daemon.wait_for_log("Cannot broadcast our commitment tx: they have a future one") @@ -3120,7 +3120,7 @@ def test_dataloss_protection_no_broadcast(node_factory, bitcoind): l1.rpc.connect(l2.info['id'], 'localhost', l2.port) # l2 should freak out! But fail when trying to send error - l2.daemon.wait_for_logs(["Peer permanent failure in CHANNELD_NORMAL: Awaiting unilateral close", + l2.daemon.wait_for_logs(["Peer permanent failure in CHANNELD_NORMAL:.* Awaiting unilateral close", 'dev_disconnect: -WIRE_ERROR']) # l1 should NOT drop to chain, since it didn't receive an error.