You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// The fee spike buffer (an additional nondust HTLC) we keep for the remote if the channel
4616
4614
// is not zero fee. This deviates from the spec because the fee spike buffer requirement
4617
4615
// doesn't exist on the receiver's side, only on the sender's.
4618
-
let fee_spike_buffer_htlc = if funding.get_channel_type().supports_anchor_zero_fee_commitments() {
4619
-
0
4620
-
} else {
4621
-
1
4622
-
};
4623
-
// 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)
4616
+
let fee_spike_buffer_htlc =
4617
+
if funding.get_channel_type().supports_anchor_zero_fee_commitments() { 0 } else { 1 };
4618
+
// Do not include outbound update_add_htlc's in the holding cell, or those which haven't yet been ACK'ed
4619
+
// by the counterparty (ie. LocalAnnounced HTLCs)
4624
4620
let include_counterparty_unknown_htlcs = false;
4625
4621
// A `None` `HTLCCandidate` is used as in this case because we're already accounting for
4626
4622
// the incoming HTLC as it has been fully committed by both sides.
4627
-
let next_local_commitment_stats = self.get_next_local_commitment_stats(funding, None, include_counterparty_unknown_htlcs, fee_spike_buffer_htlc, self.feerate_per_kw, dust_exposure_limiting_feerate);
4628
-
let next_remote_commitment_stats = self.get_next_remote_commitment_stats(funding, None, include_counterparty_unknown_htlcs, fee_spike_buffer_htlc, self.feerate_per_kw, dust_exposure_limiting_feerate);
4623
+
let next_local_commitment_stats = self.get_next_local_commitment_stats(
4624
+
funding,
4625
+
None,
4626
+
include_counterparty_unknown_htlcs,
4627
+
fee_spike_buffer_htlc,
4628
+
self.feerate_per_kw,
4629
+
dust_exposure_limiting_feerate,
4630
+
);
4631
+
let next_remote_commitment_stats = self.get_next_remote_commitment_stats(
4632
+
funding,
4633
+
None,
4634
+
include_counterparty_unknown_htlcs,
4635
+
fee_spike_buffer_htlc,
4636
+
self.feerate_per_kw,
4637
+
dust_exposure_limiting_feerate,
4638
+
);
4629
4639
4630
-
let max_dust_htlc_exposure_msat = self.get_max_dust_htlc_exposure_msat(dust_exposure_limiting_feerate);
// We unwrap here; if the HTLC exhausts the counterparty's balance, we should have rejected it at `update_add_htlc`, here the HTLC is already
4650
-
// irrevocably committed to the channel.
4651
-
let remote_balance_before_fee_msat = next_remote_commitment_stats.counterparty_balance_before_fee_msat.expect("The counterparty's balance before fees should never underflow");
4652
-
if remote_balance_before_fee_msat.saturating_sub(funding.holder_selected_channel_reserve_satoshis * 1000) < remote_fee_incl_fee_spike_buffer_htlc_msat {
4653
-
log_info!(logger, "Attempting to fail HTLC due to fee spike buffer violation in channel {}. Rebalancing is required.", &self.channel_id());
4672
+
// We unwrap here; if the HTLC exhausts the counterparty's balance, we should have rejected it
4673
+
// at `update_add_htlc`, here the HTLC is already irrevocably committed to the channel.
4674
+
let remote_balance_before_fee_msat = next_remote_commitment_stats
4675
+
.counterparty_balance_before_fee_msat
4676
+
.expect("The counterparty's balance before fees should never underflow");
0 commit comments