Skip to content

Commit 93e32d0

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 43db395 commit 93e32d0

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
@@ -5975,6 +5975,10 @@ impl<SP: Deref> FundedChannel<SP> where
59755975
{
59765976
self.commitment_signed_check_state()?;
59775977

5978+
if self.pending_splice.is_some() {
5979+
return Err(ChannelError::close("Got a single commitment_signed message when expecting a batch".to_owned()));
5980+
}
5981+
59785982
let updates = self
59795983
.context
59805984
.validate_commitment_signed(&self.funding, &self.holder_commitment_point, msg, logger)

0 commit comments

Comments
 (0)