Skip to content

Commit 4227603

Browse files
jkczyzdunxen
authored andcommitted
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 b2e0da8 commit 4227603

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
@@ -6412,6 +6412,10 @@ where
64126412
{
64136413
self.commitment_signed_check_state()?;
64146414

6415+
if !self.pending_funding.is_empty() {
6416+
return Err(ChannelError::close("Got a single commitment_signed message when expecting a batch".to_owned()));
6417+
}
6418+
64156419
let updates = self
64166420
.context
64176421
.validate_commitment_signed(&self.funding, &self.holder_commitment_point, msg, logger)

0 commit comments

Comments
 (0)