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.
This commit is contained in:
Níckolas Goline 2026-05-01 11:32:58 -03:00
parent e362c3bb12
commit e081eb3e30
No known key found for this signature in database
GPG key ID: 578CAC08472545C5

View file

@ -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;