Skip to content

Commit 0e831b4

Browse files
committed
Correct indentation in get_pending_htlc_stats
The previous commit left indentation in `get_pending_htlc_stats` deliberately wrong, to ease reviewability. This commit fixes the indentation.
1 parent 2937000 commit 0e831b4

File tree

1 file changed

+33
-33
lines changed

1 file changed

+33
-33
lines changed

lightning/src/ln/channel.rs

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2758,52 +2758,52 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
27582758

27592759
let mut pending_inbound_htlcs_value_msat = 0;
27602760
{
2761-
let counterparty_dust_limit_timeout_sat = htlc_timeout_dust_limit + context.counterparty_dust_limit_satoshis;
2762-
let holder_dust_limit_success_sat = htlc_success_dust_limit + context.holder_dust_limit_satoshis;
2763-
for ref htlc in context.pending_inbound_htlcs.iter() {
2764-
pending_inbound_htlcs_value_msat += htlc.amount_msat;
2765-
if htlc.amount_msat / 1000 < counterparty_dust_limit_timeout_sat {
2766-
on_counterparty_tx_dust_exposure_msat += htlc.amount_msat;
2767-
}
2768-
if htlc.amount_msat / 1000 < holder_dust_limit_success_sat {
2769-
on_holder_tx_dust_exposure_msat += htlc.amount_msat;
2761+
let counterparty_dust_limit_timeout_sat = htlc_timeout_dust_limit + context.counterparty_dust_limit_satoshis;
2762+
let holder_dust_limit_success_sat = htlc_success_dust_limit + context.holder_dust_limit_satoshis;
2763+
for ref htlc in context.pending_inbound_htlcs.iter() {
2764+
pending_inbound_htlcs_value_msat += htlc.amount_msat;
2765+
if htlc.amount_msat / 1000 < counterparty_dust_limit_timeout_sat {
2766+
on_counterparty_tx_dust_exposure_msat += htlc.amount_msat;
2767+
}
2768+
if htlc.amount_msat / 1000 < holder_dust_limit_success_sat {
2769+
on_holder_tx_dust_exposure_msat += htlc.amount_msat;
2770+
}
27702771
}
27712772
}
2772-
}
27732773

27742774
let mut pending_outbound_htlcs_value_msat = 0;
27752775
let mut outbound_holding_cell_msat = 0;
27762776
let mut on_holder_tx_outbound_holding_cell_htlcs_count = 0;
27772777
let mut pending_outbound_htlcs = self.pending_outbound_htlcs.len();
27782778
{
2779-
let counterparty_dust_limit_success_sat = htlc_success_dust_limit + context.counterparty_dust_limit_satoshis;
2780-
let holder_dust_limit_timeout_sat = htlc_timeout_dust_limit + context.holder_dust_limit_satoshis;
2781-
for ref htlc in context.pending_outbound_htlcs.iter() {
2782-
pending_outbound_htlcs_value_msat += htlc.amount_msat;
2783-
if htlc.amount_msat / 1000 < counterparty_dust_limit_success_sat {
2784-
on_counterparty_tx_dust_exposure_msat += htlc.amount_msat;
2785-
}
2786-
if htlc.amount_msat / 1000 < holder_dust_limit_timeout_sat {
2787-
on_holder_tx_dust_exposure_msat += htlc.amount_msat;
2779+
let counterparty_dust_limit_success_sat = htlc_success_dust_limit + context.counterparty_dust_limit_satoshis;
2780+
let holder_dust_limit_timeout_sat = htlc_timeout_dust_limit + context.holder_dust_limit_satoshis;
2781+
for ref htlc in context.pending_outbound_htlcs.iter() {
2782+
pending_outbound_htlcs_value_msat += htlc.amount_msat;
2783+
if htlc.amount_msat / 1000 < counterparty_dust_limit_success_sat {
2784+
on_counterparty_tx_dust_exposure_msat += htlc.amount_msat;
2785+
}
2786+
if htlc.amount_msat / 1000 < holder_dust_limit_timeout_sat {
2787+
on_holder_tx_dust_exposure_msat += htlc.amount_msat;
2788+
}
27882789
}
2789-
}
27902790

2791-
for update in context.holding_cell_htlc_updates.iter() {
2792-
if let &HTLCUpdateAwaitingACK::AddHTLC { ref amount_msat, .. } = update {
2793-
pending_outbound_htlcs += 1;
2794-
pending_outbound_htlcs_value_msat += amount_msat;
2795-
outbound_holding_cell_msat += amount_msat;
2796-
if *amount_msat / 1000 < counterparty_dust_limit_success_sat {
2797-
on_counterparty_tx_dust_exposure_msat += amount_msat;
2798-
}
2799-
if *amount_msat / 1000 < holder_dust_limit_timeout_sat {
2800-
on_holder_tx_dust_exposure_msat += amount_msat;
2801-
} else {
2802-
on_holder_tx_outbound_holding_cell_htlcs_count += 1;
2791+
for update in context.holding_cell_htlc_updates.iter() {
2792+
if let &HTLCUpdateAwaitingACK::AddHTLC { ref amount_msat, .. } = update {
2793+
pending_outbound_htlcs += 1;
2794+
pending_outbound_htlcs_value_msat += amount_msat;
2795+
outbound_holding_cell_msat += amount_msat;
2796+
if *amount_msat / 1000 < counterparty_dust_limit_success_sat {
2797+
on_counterparty_tx_dust_exposure_msat += amount_msat;
2798+
}
2799+
if *amount_msat / 1000 < holder_dust_limit_timeout_sat {
2800+
on_holder_tx_dust_exposure_msat += amount_msat;
2801+
} else {
2802+
on_holder_tx_outbound_holding_cell_htlcs_count += 1;
2803+
}
28032804
}
28042805
}
28052806
}
2806-
}
28072807

28082808
HTLCStats {
28092809
pending_inbound_htlcs: self.pending_inbound_htlcs.len(),

0 commit comments

Comments
 (0)