Skip to content

Ignore start_batch for missing or unexpected message_type #3874

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 18, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 7 additions & 13 deletions lightning/src/ln/peer_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2204,8 +2204,8 @@ where
.into());
}

const COMMITMENT_SIGNED_BATCH_LIMIT: usize = 20;
if batch_size > COMMITMENT_SIGNED_BATCH_LIMIT {
const BATCH_SIZE_LIMIT: usize = 20;
if batch_size > BATCH_SIZE_LIMIT {
let error = format!(
"Peer {} sent start_batch for channel {} exceeding the limit",
log_pubkey!(their_node_id),
Expand All @@ -2227,19 +2227,13 @@ where
MessageBatchImpl::CommitmentSigned(messages)
},
_ => {
let error = format!(
"Peer {} sent start_batch for channel {} without a known message type",
log_debug!(
logger,
"Peer {} sent start_batch for channel {} without a known message type; ignoring",
log_pubkey!(their_node_id),
&msg.channel_id
&msg.channel_id,
);
log_debug!(logger, "{}", error);
return Err(LightningError {
err: error.clone(),
action: msgs::ErrorAction::DisconnectPeerWithWarning {
msg: msgs::WarningMessage { channel_id: msg.channel_id, data: error },
},
}
.into());
return Ok(None);
},
};

Expand Down
Loading