Skip to content

Commit

Permalink
lightningd: let channeld/dual_openingd send error to peer.
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
rustyrussell committed Oct 22, 2023
1 parent e9b6423 commit b85431b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
5 changes: 0 additions & 5 deletions lightningd/channel_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit b85431b

Please sign in to comment.