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
let htlc_stats = self.get_pending_htlc_stats(funding, None, dust_exposure_limiting_feerate);
4501
+
// `Some(())` is for the fee spike buffer we keep for the remote if the channel is not zero fee. This deviates from the spec because the fee spike buffer requirement
4502
+
// doesn't exist on the receiver's side, only on the sender's. Note that with anchor
4503
+
// outputs we are no longer as sensitive to fee spikes, so we need to account for them.
4504
+
//
4505
+
// A `None` `HTLCCandidate` is used as in this case because we're already accounting for
4506
+
// the incoming HTLC as it has been fully committed by both sides.
4507
+
let fee_spike_buffer_htlc = if funding.get_channel_type().supports_anchor_zero_fee_commitments() {
4508
+
0
4509
+
} else {
4510
+
1
4511
+
};
4512
+
let next_local_commitment_stats = self.get_next_local_commitment_stats(funding, None, false, fee_spike_buffer_htlc, self.feerate_per_kw, dust_exposure_limiting_feerate);
4513
+
let next_remote_commitment_stats = self.get_next_remote_commitment_stats(funding, None, false, fee_spike_buffer_htlc, self.feerate_per_kw, dust_exposure_limiting_feerate);
4514
+
4502
4515
let max_dust_htlc_exposure_msat = self.get_max_dust_htlc_exposure_msat(dust_exposure_limiting_feerate);
4503
-
let on_counterparty_tx_dust_htlc_exposure_msat = htlc_stats.on_counterparty_tx_dust_exposure_msat;
4504
-
if on_counterparty_tx_dust_htlc_exposure_msat > max_dust_htlc_exposure_msat {
4516
+
if next_remote_commitment_stats.dust_exposure_msat > max_dust_htlc_exposure_msat {
4505
4517
// Note that the total dust exposure includes both the dust HTLCs and the excess mining fees of the counterparty commitment transaction
4506
4518
log_info!(logger, "Cannot accept value that would put our total dust exposure at {} over the limit {} on counterparty commitment tx",
0 commit comments