Skip to content

Commit 1f8a7d7

Browse files
committed
Return ChannelError instead of calling expect
1 parent 3ae8c4a commit 1f8a7d7

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lightning/src/ln/channel.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6984,10 +6984,12 @@ where
69846984
.and_then(|funding_negotiation| funding_negotiation.as_funding())
69856985
.expect("Funding must exist for negotiated pending splice");
69866986
let transaction_number = self.holder_commitment_point.current_transaction_number();
6987-
let commitment_point = self
6988-
.holder_commitment_point
6989-
.current_point()
6990-
.expect("current should be set after receiving the initial commitment_signed");
6987+
let commitment_point = self.holder_commitment_point.current_point().ok_or_else(|| {
6988+
debug_assert!(false);
6989+
ChannelError::close(
6990+
"current_point should be set for channels initiating splicing".to_owned(),
6991+
)
6992+
})?;
69916993
let (holder_commitment_tx, _) = self.context.validate_commitment_signed(
69926994
pending_splice_funding,
69936995
transaction_number,

0 commit comments

Comments
 (0)