@@ -3954,11 +3954,12 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
3954
3954
}
3955
3955
3956
3956
/// Asserts that the commitment tx numbers have not advanced from their initial number.
3957
- fn assert_no_commitment_advancement(&self) {
3957
+ fn assert_no_commitment_advancement(&self, msg_name: &str ) {
3958
3958
if self.commitment_secrets.get_min_seen_secret() != (1 << 48) ||
3959
3959
self.cur_counterparty_commitment_transaction_number != INITIAL_COMMITMENT_NUMBER ||
3960
3960
self.holder_commitment_point.transaction_number() != INITIAL_COMMITMENT_NUMBER {
3961
- debug_assert!(false, "Should not have advanced channel commitment tx numbers prior to funding_created");
3961
+ debug_assert!(false, "Should not have advanced channel commitment tx numbers prior to {}",
3962
+ msg_name);
3962
3963
}
3963
3964
}
3964
3965
@@ -4001,11 +4002,7 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
4001
4002
if flags == (NegotiatingFundingFlags::OUR_INIT_SENT | NegotiatingFundingFlags::THEIR_INIT_SENT)) {
4002
4003
panic!("Tried to get a funding_created messsage at a time other than immediately after initial handshake completion (or tried to get funding_created twice)");
4003
4004
}
4004
- if self.commitment_secrets.get_min_seen_secret() != (1 << 48) ||
4005
- self.cur_counterparty_commitment_transaction_number != INITIAL_COMMITMENT_NUMBER ||
4006
- self.holder_commitment_point.transaction_number() != INITIAL_COMMITMENT_NUMBER {
4007
- panic!("Should not have advanced channel commitment tx numbers prior to initial commitment_signed");
4008
- }
4005
+ self.assert_no_commitment_advancement("initial commitment_signed");
4009
4006
4010
4007
let signature = match self.get_initial_counterparty_commitment_signature(logger) {
4011
4008
Ok(res) => res,
@@ -4938,7 +4935,7 @@ impl<SP: Deref> Channel<SP> where
4938
4935
ClosureReason::HolderForceClosed { broadcasted_latest_txn: Some(false) },
4939
4936
)));
4940
4937
}
4941
- self.context.assert_no_commitment_advancement();
4938
+ self.context.assert_no_commitment_advancement("initial commitment_signed" );
4942
4939
4943
4940
let (channel_monitor, _) = self.initial_commitment_signed(
4944
4941
self.context.channel_id(), msg.signature,
@@ -8262,7 +8259,7 @@ impl<SP: Deref> OutboundV1Channel<SP> where SP::Target: SignerProvider {
8262
8259
) {
8263
8260
panic!("Tried to get a funding_created messsage at a time other than immediately after initial handshake completion (or tried to get funding_created twice)");
8264
8261
}
8265
- self.context.assert_no_commitment_advancement();
8262
+ self.context.assert_no_commitment_advancement("funding_created" );
8266
8263
8267
8264
self.context.channel_transaction_parameters.funding_outpoint = Some(funding_txo);
8268
8265
self.context.holder_signer.as_mut().provide_channel_parameters(&self.context.channel_transaction_parameters);
@@ -8387,7 +8384,7 @@ impl<SP: Deref> OutboundV1Channel<SP> where SP::Target: SignerProvider {
8387
8384
if !matches!(self.context.channel_state, ChannelState::FundingNegotiated) {
8388
8385
return Err((self, ChannelError::close("Received funding_signed in strange state!".to_owned())));
8389
8386
}
8390
- self.context.assert_no_commitment_advancement();
8387
+ self.context.assert_no_commitment_advancement("funding_created" );
8391
8388
8392
8389
let (channel_monitor, _) = match self.initial_commitment_signed(
8393
8390
self.context.channel_id(),
@@ -8601,7 +8598,7 @@ impl<SP: Deref> InboundV1Channel<SP> where SP::Target: SignerProvider {
8601
8598
// channel.
8602
8599
return Err((self, ChannelError::close("Received funding_created after we got the channel!".to_owned())));
8603
8600
}
8604
- self.context.assert_no_commitment_advancement();
8601
+ self.context.assert_no_commitment_advancement("funding_created" );
8605
8602
8606
8603
let funding_txo = OutPoint { txid: msg.funding_txid, index: msg.funding_output_index };
8607
8604
self.context.channel_transaction_parameters.funding_outpoint = Some(funding_txo);
0 commit comments