Skip to content

Commit 111c0ec

Browse files
committed
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.
1 parent 9ba995c commit 111c0ec

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

channeld/channeld.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5205,21 +5205,26 @@ static void peer_in(struct peer *peer, const u8 *msg)
52055205
case WIRE_TX_ABORT:
52065206
check_tx_abort(peer, msg, NULL);
52075207
return;
5208+
case WIRE_CLOSING_COMPLETE:
5209+
case WIRE_CLOSING_SIG:
52085210
case WIRE_INIT:
52095211
case WIRE_OPEN_CHANNEL:
52105212
case WIRE_ACCEPT_CHANNEL:
52115213
case WIRE_FUNDING_CREATED:
52125214
case WIRE_FUNDING_SIGNED:
52135215
case WIRE_CLOSING_SIGNED:
5214-
case WIRE_CLOSING_COMPLETE:
5215-
case WIRE_CLOSING_SIG:
52165216
case WIRE_TX_ADD_INPUT:
52175217
case WIRE_TX_REMOVE_INPUT:
52185218
case WIRE_TX_ADD_OUTPUT:
52195219
case WIRE_TX_REMOVE_OUTPUT:
52205220
case WIRE_TX_COMPLETE:
52215221
case WIRE_OPEN_CHANNEL2:
52225222
case WIRE_ACCEPT_CHANNEL2:
5223+
peer_failed_warn(peer->pps, &peer->channel_id,
5224+
"Peer sent unexpected message %s",
5225+
peer_wire_name(type));
5226+
return;
5227+
52235228
case WIRE_TX_SIGNATURES:
52245229
handle_unexpected_tx_sigs(peer, msg);
52255230
return;

0 commit comments

Comments
 (0)