Skip to content

Commit 27eec8d

Browse files
committed
correct units on per_outbound_htlc_counterparty_commit_tx_fee_msat
1 parent 61a6b09 commit 27eec8d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lightning/src/ln/chan_utils.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,11 +199,11 @@ pub(crate) fn commit_tx_fee_sat(feerate_per_kw: u32, num_htlcs: usize, channel_t
199199
pub(crate) fn per_outbound_htlc_counterparty_commit_tx_fee_msat(feerate_per_kw: u32, channel_type_features: &ChannelTypeFeatures) -> u64 {
200200
// Note that we need to divide before multiplying to round properly,
201201
// since the lowest denomination of bitcoin on-chain is the satoshi.
202-
let commitment_tx_fee = COMMITMENT_TX_WEIGHT_PER_HTLC * feerate_per_kw as u64 / 1000 * 1000;
202+
let commitment_tx_fee_msat = COMMITMENT_TX_WEIGHT_PER_HTLC * feerate_per_kw as u64 / 1000 * 1000;
203203
if channel_type_features.supports_anchors_zero_fee_htlc_tx() {
204-
commitment_tx_fee
204+
commitment_tx_fee_msat
205205
} else {
206-
commitment_tx_fee + htlc_success_tx_weight(channel_type_features) * feerate_per_kw as u64 / 1000
206+
commitment_tx_fee_msat + htlc_success_tx_weight(channel_type_features) * feerate_per_kw as u64
207207
}
208208
}
209209

0 commit comments

Comments
 (0)