Skip to content

Commit 9db0fb2

Browse files
authored
Merge pull request #3874 from jkczyz/2025-06-ignore-start-batch
Ignore `start_batch` for missing or unexpected `message_type`
2 parents 1898755 + 3a99020 commit 9db0fb2

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

lightning/src/ln/peer_handler.rs

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2204,8 +2204,8 @@ where
22042204
.into());
22052205
}
22062206

2207-
const COMMITMENT_SIGNED_BATCH_LIMIT: usize = 20;
2208-
if batch_size > COMMITMENT_SIGNED_BATCH_LIMIT {
2207+
const BATCH_SIZE_LIMIT: usize = 20;
2208+
if batch_size > BATCH_SIZE_LIMIT {
22092209
let error = format!(
22102210
"Peer {} sent start_batch for channel {} exceeding the limit",
22112211
log_pubkey!(their_node_id),
@@ -2227,19 +2227,13 @@ where
22272227
MessageBatchImpl::CommitmentSigned(messages)
22282228
},
22292229
_ => {
2230-
let error = format!(
2231-
"Peer {} sent start_batch for channel {} without a known message type",
2230+
log_debug!(
2231+
logger,
2232+
"Peer {} sent start_batch for channel {} without a known message type; ignoring",
22322233
log_pubkey!(their_node_id),
2233-
&msg.channel_id
2234+
&msg.channel_id,
22342235
);
2235-
log_debug!(logger, "{}", error);
2236-
return Err(LightningError {
2237-
err: error.clone(),
2238-
action: msgs::ErrorAction::DisconnectPeerWithWarning {
2239-
msg: msgs::WarningMessage { channel_id: msg.channel_id, data: error },
2240-
},
2241-
}
2242-
.into());
2236+
return Ok(None);
22432237
},
22442238
};
22452239

0 commit comments

Comments
 (0)