Skip to content

Commit 5004ea9

Browse files
committed
Check if a batch is expected for commitment_signed
When receiving a commitment_signed message, if there are any pending splices then we are expected to receive the message as a part of a batch. Otherwise, the spec dictates that we should send an error and fail the channel.
1 parent 3333b6d commit 5004ea9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lightning/src/ln/channel.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6399,6 +6399,10 @@ where
63996399
{
64006400
self.commitment_signed_check_state()?;
64016401

6402+
if !self.pending_funding.is_empty() {
6403+
return Err(ChannelError::close("Got a single commitment_signed message when expecting a batch".to_owned()));
6404+
}
6405+
64026406
let updates = self
64036407
.context
64046408
.validate_commitment_signed(&self.funding, &self.holder_commitment_point, msg, logger)

0 commit comments

Comments
 (0)