Skip to content

Commit 63604cb

Browse files
committed
Remove some #[rustfmt::skip] from channel.rs
1 parent c51b6ff commit 63604cb

File tree

1 file changed

+39
-18
lines changed

1 file changed

+39
-18
lines changed

lightning/src/ln/channel.rs

Lines changed: 39 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5578,33 +5578,49 @@ where
55785578
}
55795579

55805580
/// 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+
);
55885593
}
55895594
}
55905595

5591-
#[rustfmt::skip]
55925596
fn get_initial_counterparty_commitment_signature<L: Deref>(
5593-
&self, funding: &FundingScope, logger: &L
5597+
&self, funding: &FundingScope, logger: &L,
55945598
) -> Option<Signature>
55955599
where
55965600
SP::Target: SignerProvider,
5597-
L::Target: Logger
5601+
L::Target: Logger,
55985602
{
5599-
let commitment_data = self.build_commitment_transaction(funding,
5603+
let commitment_data = self.build_commitment_transaction(
5604+
funding,
56005605
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+
);
56025611
let counterparty_initial_commitment_tx = commitment_data.tx;
56035612
match self.holder_signer {
56045613
// TODO (taproot|arik): move match into calling method for Taproot
56055614
ChannelSignerType::Ecdsa(ref ecdsa) => {
56065615
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+
)
56085624
.map(|(signature, _)| signature)
56095625
.ok()
56105626
},
@@ -5614,19 +5630,24 @@ where
56145630
}
56155631
}
56165632

5617-
#[rustfmt::skip]
56185633
fn get_initial_commitment_signed_v2<L: Deref>(
5619-
&mut self, funding: &FundingScope, logger: &L
5634+
&mut self, funding: &FundingScope, logger: &L,
56205635
) -> Option<msgs::CommitmentSigned>
56215636
where
56225637
SP::Target: SignerProvider,
5623-
L::Target: Logger
5638+
L::Target: Logger,
56245639
{
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+
);
56265643

56275644
let signature = self.get_initial_counterparty_commitment_signature(funding, logger);
56285645
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+
);
56305651
Some(msgs::CommitmentSigned {
56315652
channel_id: self.channel_id,
56325653
htlc_signatures: vec![],

0 commit comments

Comments
 (0)