From e081eb3e30ec91f5cfdc1831ed616deea499ee5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=ADckolas=20Goline?= Date: Fri, 1 May 2026 11:32:58 -0300 Subject: [PATCH] channeld: reject `closing_complete` and `closing_sig` with a clear error When `option_simple_close` is negotiated the master launches `simpleclosed` after `channeld` exits, so `closing_complete` and `closing_sig` should never arrive inside `channeld`. Add stubs that call peer_failed_warn() with an informative message rather than hitting the default unknown-message path. --- channeld/channeld.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/channeld/channeld.c b/channeld/channeld.c index b2e662fdb..3848f0d2e 100644 --- a/channeld/channeld.c +++ b/channeld/channeld.c @@ -5211,14 +5211,14 @@ static void peer_in(struct peer *peer, const u8 *msg) case WIRE_TX_ABORT: check_tx_abort(peer, msg, NULL); return; + case WIRE_CLOSING_COMPLETE: + case WIRE_CLOSING_SIG: case WIRE_INIT: case WIRE_OPEN_CHANNEL: case WIRE_ACCEPT_CHANNEL: case WIRE_FUNDING_CREATED: case WIRE_FUNDING_SIGNED: case WIRE_CLOSING_SIGNED: - case WIRE_CLOSING_COMPLETE: - case WIRE_CLOSING_SIG: case WIRE_TX_ADD_INPUT: case WIRE_TX_REMOVE_INPUT: case WIRE_TX_ADD_OUTPUT: @@ -5226,6 +5226,11 @@ static void peer_in(struct peer *peer, const u8 *msg) case WIRE_TX_COMPLETE: case WIRE_OPEN_CHANNEL2: case WIRE_ACCEPT_CHANNEL2: + peer_failed_warn(peer->pps, &peer->channel_id, + "Peer sent unexpected message %s", + peer_wire_name(type)); + return; + case WIRE_TX_SIGNATURES: handle_unexpected_tx_sigs(peer, msg); return;