@@ -5578,33 +5578,49 @@ where
5578
5578
}
5579
5579
5580
5580
/// Asserts that the commitment tx numbers have not advanced from their initial number.
5581
- #[rustfmt::skip]
5582
- fn assert_no_commitment_advancement(&self, holder_commitment_transaction_number: u64, msg_name: &str) {
5583
- if self.commitment_secrets.get_min_seen_secret() != (1 << 48) ||
5584
- self.cur_counterparty_commitment_transaction_number != INITIAL_COMMITMENT_NUMBER ||
5585
- holder_commitment_transaction_number != INITIAL_COMMITMENT_NUMBER {
5586
- debug_assert!(false, "Should not have advanced channel commitment tx numbers prior to {}",
5587
- msg_name);
5581
+ fn assert_no_commitment_advancement(
5582
+ &self, holder_commitment_transaction_number: u64, msg_name: &str,
5583
+ ) {
5584
+ if self.commitment_secrets.get_min_seen_secret() != (1 << 48)
5585
+ || self.cur_counterparty_commitment_transaction_number != INITIAL_COMMITMENT_NUMBER
5586
+ || holder_commitment_transaction_number != INITIAL_COMMITMENT_NUMBER
5587
+ {
5588
+ debug_assert!(
5589
+ false,
5590
+ "Should not have advanced channel commitment tx numbers prior to {}",
5591
+ msg_name
5592
+ );
5588
5593
}
5589
5594
}
5590
5595
5591
- #[rustfmt::skip]
5592
5596
fn get_initial_counterparty_commitment_signature<L: Deref>(
5593
- &self, funding: &FundingScope, logger: &L
5597
+ &self, funding: &FundingScope, logger: &L,
5594
5598
) -> Option<Signature>
5595
5599
where
5596
5600
SP::Target: SignerProvider,
5597
- L::Target: Logger
5601
+ L::Target: Logger,
5598
5602
{
5599
- let commitment_data = self.build_commitment_transaction(funding,
5603
+ let commitment_data = self.build_commitment_transaction(
5604
+ funding,
5600
5605
self.cur_counterparty_commitment_transaction_number,
5601
- &self.counterparty_cur_commitment_point.unwrap(), false, false, logger);
5606
+ &self.counterparty_cur_commitment_point.unwrap(),
5607
+ false,
5608
+ false,
5609
+ logger,
5610
+ );
5602
5611
let counterparty_initial_commitment_tx = commitment_data.tx;
5603
5612
match self.holder_signer {
5604
5613
// TODO (taproot|arik): move match into calling method for Taproot
5605
5614
ChannelSignerType::Ecdsa(ref ecdsa) => {
5606
5615
let channel_parameters = &funding.channel_transaction_parameters;
5607
- ecdsa.sign_counterparty_commitment(channel_parameters, &counterparty_initial_commitment_tx, Vec::new(), Vec::new(), &self.secp_ctx)
5616
+ ecdsa
5617
+ .sign_counterparty_commitment(
5618
+ channel_parameters,
5619
+ &counterparty_initial_commitment_tx,
5620
+ Vec::new(),
5621
+ Vec::new(),
5622
+ &self.secp_ctx,
5623
+ )
5608
5624
.map(|(signature, _)| signature)
5609
5625
.ok()
5610
5626
},
@@ -5614,19 +5630,24 @@ where
5614
5630
}
5615
5631
}
5616
5632
5617
- #[rustfmt::skip]
5618
5633
fn get_initial_commitment_signed_v2<L: Deref>(
5619
- &mut self, funding: &FundingScope, logger: &L
5634
+ &mut self, funding: &FundingScope, logger: &L,
5620
5635
) -> Option<msgs::CommitmentSigned>
5621
5636
where
5622
5637
SP::Target: SignerProvider,
5623
- L::Target: Logger
5638
+ L::Target: Logger,
5624
5639
{
5625
- assert!(matches!(self.channel_state, ChannelState::FundingNegotiated(flags) if flags.is_interactive_signing()));
5640
+ assert!(
5641
+ matches!(self.channel_state, ChannelState::FundingNegotiated(flags) if flags.is_interactive_signing())
5642
+ );
5626
5643
5627
5644
let signature = self.get_initial_counterparty_commitment_signature(funding, logger);
5628
5645
if let Some(signature) = signature {
5629
- log_info!(logger, "Generated commitment_signed for peer for channel {}", &self.channel_id());
5646
+ log_info!(
5647
+ logger,
5648
+ "Generated commitment_signed for peer for channel {}",
5649
+ &self.channel_id()
5650
+ );
5630
5651
Some(msgs::CommitmentSigned {
5631
5652
channel_id: self.channel_id,
5632
5653
htlc_signatures: vec![],
0 commit comments