Skip to content

Commit f67143a

Browse files
committed
Run fmt on validate_update_fee
1 parent b58d1d0 commit f67143a

File tree

1 file changed

+36
-12
lines changed

1 file changed

+36
-12
lines changed

lightning/src/ln/channel.rs

Lines changed: 36 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4451,7 +4451,6 @@ where
44514451
Ok(())
44524452
}
44534453

4454-
#[rustfmt::skip]
44554454
fn validate_update_fee<F: Deref>(
44564455
&self, funding: &FundingScope, fee_estimator: &LowerBoundedFeeEstimator<F>,
44574456
msg: &msgs::UpdateFee,
@@ -4460,22 +4459,47 @@ where
44604459
F::Target: FeeEstimator,
44614460
{
44624461
// Check that we won't be pushed over our dust exposure limit by the feerate increase.
4463-
let dust_exposure_limiting_feerate = self.get_dust_exposure_limiting_feerate(
4464-
&fee_estimator, funding.get_channel_type(),
4465-
);
4466-
// Do not include outbound update_add_htlc's in the holding cell, or those which haven't yet been ACK'ed by the counterparty (ie. LocalAnnounced HTLCs)
4462+
let dust_exposure_limiting_feerate =
4463+
self.get_dust_exposure_limiting_feerate(&fee_estimator, funding.get_channel_type());
4464+
// Do not include outbound update_add_htlc's in the holding cell, or those which haven't yet been ACK'ed
4465+
// by the counterparty (ie. LocalAnnounced HTLCs)
44674466
let include_counterparty_unknown_htlcs = false;
4468-
let next_local_commitment_stats = self.get_next_local_commitment_stats(funding, None, include_counterparty_unknown_htlcs, 0, msg.feerate_per_kw, dust_exposure_limiting_feerate);
4469-
let next_remote_commitment_stats = self.get_next_remote_commitment_stats(funding, None, include_counterparty_unknown_htlcs, 0, msg.feerate_per_kw, dust_exposure_limiting_feerate);
4467+
let next_local_commitment_stats = self.get_next_local_commitment_stats(
4468+
funding,
4469+
None,
4470+
include_counterparty_unknown_htlcs,
4471+
0,
4472+
msg.feerate_per_kw,
4473+
dust_exposure_limiting_feerate,
4474+
);
4475+
let next_remote_commitment_stats = self.get_next_remote_commitment_stats(
4476+
funding,
4477+
None,
4478+
include_counterparty_unknown_htlcs,
4479+
0,
4480+
msg.feerate_per_kw,
4481+
dust_exposure_limiting_feerate,
4482+
);
44704483

4471-
let max_dust_htlc_exposure_msat = self.get_max_dust_htlc_exposure_msat(dust_exposure_limiting_feerate);
4484+
let max_dust_htlc_exposure_msat =
4485+
self.get_max_dust_htlc_exposure_msat(dust_exposure_limiting_feerate);
44724486
if next_local_commitment_stats.dust_exposure_msat > max_dust_htlc_exposure_msat {
4473-
return Err(ChannelError::close(format!("Peer sent update_fee with a feerate ({}) which may over-expose us to dust-in-flight on our own transactions (totaling {} msat)",
4474-
msg.feerate_per_kw, next_local_commitment_stats.dust_exposure_msat)));
4487+
return Err(ChannelError::close(
4488+
format!(
4489+
"Peer sent update_fee with a feerate ({}) which may over-expose us to dust-in-flight on our own transactions (totaling {} msat)",
4490+
msg.feerate_per_kw,
4491+
next_local_commitment_stats.dust_exposure_msat,
4492+
)
4493+
));
44754494
}
44764495
if next_remote_commitment_stats.dust_exposure_msat > max_dust_htlc_exposure_msat {
4477-
return Err(ChannelError::close(format!("Peer sent update_fee with a feerate ({}) which may over-expose us to dust-in-flight on our counterparty's transactions (totaling {} msat)",
4478-
msg.feerate_per_kw, next_remote_commitment_stats.dust_exposure_msat)));
4496+
return Err(ChannelError::close(
4497+
format!(
4498+
"Peer sent update_fee with a feerate ({}) which may over-expose us to dust-in-flight on our counterparty's transactions (totaling {} msat)",
4499+
msg.feerate_per_kw,
4500+
next_remote_commitment_stats.dust_exposure_msat,
4501+
)
4502+
));
44794503
}
44804504

44814505
Ok(())

0 commit comments

Comments
 (0)