Skip to content

Commit 6ebb6d1

Browse files
authored
Merge pull request #2354 from alecchendev/2023-06-bump-default-dust-exp
Bump dust exposure threshold
2 parents 3236be1 + b040335 commit 6ebb6d1

File tree

9 files changed

+323
-119
lines changed

9 files changed

+323
-119
lines changed

fuzz/src/full_stack.rs

Lines changed: 17 additions & 2 deletions
Large diffs are not rendered by default.

lightning/src/ln/channel.rs

Lines changed: 90 additions & 42 deletions
Large diffs are not rendered by default.

lightning/src/ln/channelmanager.rs

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1522,10 +1522,13 @@ impl ChannelDetails {
15221522
self.short_channel_id.or(self.outbound_scid_alias)
15231523
}
15241524

1525-
fn from_channel_context<Signer: WriteableEcdsaChannelSigner>(context: &ChannelContext<Signer>,
1526-
best_block_height: u32, latest_features: InitFeatures) -> Self {
1527-
1528-
let balance = context.get_available_balances();
1525+
fn from_channel_context<Signer: WriteableEcdsaChannelSigner, F: Deref>(
1526+
context: &ChannelContext<Signer>, best_block_height: u32, latest_features: InitFeatures,
1527+
fee_estimator: &LowerBoundedFeeEstimator<F>
1528+
) -> Self
1529+
where F::Target: FeeEstimator
1530+
{
1531+
let balance = context.get_available_balances(fee_estimator);
15291532
let (to_remote_reserve_satoshis, to_self_reserve_satoshis) =
15301533
context.get_holder_counterparty_selected_channel_reserve_satoshis();
15311534
ChannelDetails {
@@ -2240,7 +2243,7 @@ where
22402243
let peer_state = &mut *peer_state_lock;
22412244
for (_channel_id, channel) in peer_state.channel_by_id.iter().filter(f) {
22422245
let details = ChannelDetails::from_channel_context(&channel.context, best_block_height,
2243-
peer_state.latest_features.clone());
2246+
peer_state.latest_features.clone(), &self.fee_estimator);
22442247
res.push(details);
22452248
}
22462249
}
@@ -2266,17 +2269,17 @@ where
22662269
let peer_state = &mut *peer_state_lock;
22672270
for (_channel_id, channel) in peer_state.channel_by_id.iter() {
22682271
let details = ChannelDetails::from_channel_context(&channel.context, best_block_height,
2269-
peer_state.latest_features.clone());
2272+
peer_state.latest_features.clone(), &self.fee_estimator);
22702273
res.push(details);
22712274
}
22722275
for (_channel_id, channel) in peer_state.inbound_v1_channel_by_id.iter() {
22732276
let details = ChannelDetails::from_channel_context(&channel.context, best_block_height,
2274-
peer_state.latest_features.clone());
2277+
peer_state.latest_features.clone(), &self.fee_estimator);
22752278
res.push(details);
22762279
}
22772280
for (_channel_id, channel) in peer_state.outbound_v1_channel_by_id.iter() {
22782281
let details = ChannelDetails::from_channel_context(&channel.context, best_block_height,
2279-
peer_state.latest_features.clone());
2282+
peer_state.latest_features.clone(), &self.fee_estimator);
22802283
res.push(details);
22812284
}
22822285
}
@@ -2309,7 +2312,8 @@ where
23092312
return peer_state.channel_by_id
23102313
.iter()
23112314
.map(|(_, channel)|
2312-
ChannelDetails::from_channel_context(&channel.context, best_block_height, features.clone()))
2315+
ChannelDetails::from_channel_context(&channel.context, best_block_height,
2316+
features.clone(), &self.fee_estimator))
23132317
.collect();
23142318
}
23152319
vec![]
@@ -3113,7 +3117,7 @@ where
31133117
session_priv: session_priv.clone(),
31143118
first_hop_htlc_msat: htlc_msat,
31153119
payment_id,
3116-
}, onion_packet, None, &self.logger);
3120+
}, onion_packet, None, &self.fee_estimator, &self.logger);
31173121
match break_chan_entry!(self, send_res, chan) {
31183122
Some(monitor_update) => {
31193123
match handle_new_monitor_update!(self, funding_txo, monitor_update, peer_state_lock, peer_state, per_peer_state, chan) {
@@ -3830,7 +3834,8 @@ where
38303834
});
38313835
if let Err(e) = chan.get_mut().queue_add_htlc(outgoing_amt_msat,
38323836
payment_hash, outgoing_cltv_value, htlc_source.clone(),
3833-
onion_packet, skimmed_fee_msat, &self.logger)
3837+
onion_packet, skimmed_fee_msat, &self.fee_estimator,
3838+
&self.logger)
38343839
{
38353840
if let ChannelError::Ignore(msg) = e {
38363841
log_trace!(self.logger, "Failed to forward HTLC with payment_hash {}: {}", log_bytes!(payment_hash.0), msg);
@@ -4219,7 +4224,7 @@ where
42194224
log_trace!(self.logger, "Channel {} qualifies for a feerate change from {} to {}.",
42204225
log_bytes!(chan_id[..]), chan.context.get_feerate_sat_per_1000_weight(), new_feerate);
42214226

4222-
chan.queue_update_fee(new_feerate, &self.logger);
4227+
chan.queue_update_fee(new_feerate, &self.fee_estimator, &self.logger);
42234228
NotifyOption::DoPersist
42244229
}
42254230

@@ -5555,7 +5560,7 @@ where
55555560
_ => pending_forward_info
55565561
}
55575562
};
5558-
try_chan_entry!(self, chan.get_mut().update_add_htlc(&msg, pending_forward_info, create_pending_htlc_status, &self.logger), chan);
5563+
try_chan_entry!(self, chan.get_mut().update_add_htlc(&msg, pending_forward_info, create_pending_htlc_status, &self.fee_estimator, &self.logger), chan);
55595564
},
55605565
hash_map::Entry::Vacant(_) => return Err(MsgHandleErrInternal::send_err_msg_no_close(format!("Got a message for a channel from the wrong node! No such channel for the passed counterparty_node_id {}", counterparty_node_id), msg.channel_id))
55615566
}
@@ -5772,7 +5777,7 @@ where
57725777
match peer_state.channel_by_id.entry(msg.channel_id) {
57735778
hash_map::Entry::Occupied(mut chan) => {
57745779
let funding_txo = chan.get().context.get_funding_txo();
5775-
let (htlcs_to_fail, monitor_update_opt) = try_chan_entry!(self, chan.get_mut().revoke_and_ack(&msg, &self.logger), chan);
5780+
let (htlcs_to_fail, monitor_update_opt) = try_chan_entry!(self, chan.get_mut().revoke_and_ack(&msg, &self.fee_estimator, &self.logger), chan);
57765781
let res = if let Some(monitor_update) = monitor_update_opt {
57775782
handle_new_monitor_update!(self, funding_txo.unwrap(), monitor_update,
57785783
peer_state_lock, peer_state, per_peer_state, chan).map(|_| ())
@@ -6043,7 +6048,7 @@ where
60436048
let counterparty_node_id = chan.context.get_counterparty_node_id();
60446049
let funding_txo = chan.context.get_funding_txo();
60456050
let (monitor_opt, holding_cell_failed_htlcs) =
6046-
chan.maybe_free_holding_cell_htlcs(&self.logger);
6051+
chan.maybe_free_holding_cell_htlcs(&self.fee_estimator, &self.logger);
60476052
if !holding_cell_failed_htlcs.is_empty() {
60486053
failed_htlcs.push((holding_cell_failed_htlcs, *channel_id, counterparty_node_id));
60496054
}
@@ -10060,7 +10065,7 @@ pub mod bench {
1006010065
use crate::routing::gossip::NetworkGraph;
1006110066
use crate::routing::router::{PaymentParameters, RouteParameters};
1006210067
use crate::util::test_utils;
10063-
use crate::util::config::UserConfig;
10068+
use crate::util::config::{UserConfig, MaxDustHTLCExposure};
1006410069

1006510070
use bitcoin::hashes::Hash;
1006610071
use bitcoin::hashes::sha256::Hash as Sha256;
@@ -10107,6 +10112,7 @@ pub mod bench {
1010710112
let router = test_utils::TestRouter::new(Arc::new(NetworkGraph::new(network, &logger_a)), &scorer);
1010810113

1010910114
let mut config: UserConfig = Default::default();
10115+
config.channel_config.max_dust_htlc_exposure = MaxDustHTLCExposure::FeeRateMultiplier(5_000_000 / 253);
1011010116
config.channel_handshake_config.minimum_depth = 1;
1011110117

1011210118
let chain_monitor_a = ChainMonitor::new(None, &tx_broadcaster, &logger_a, &fee_estimator, &persister_a);

lightning/src/ln/functional_test_utils.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ use crate::util::scid_utils;
2727
use crate::util::test_utils;
2828
use crate::util::test_utils::{panicking, TestChainMonitor, TestScorer, TestKeysInterface};
2929
use crate::util::errors::APIError;
30-
use crate::util::config::UserConfig;
30+
use crate::util::config::{UserConfig, MaxDustHTLCExposure};
3131
use crate::util::ser::{ReadableArgs, Writeable};
3232

3333
use bitcoin::blockdata::block::{Block, BlockHeader};
@@ -2582,8 +2582,10 @@ pub fn test_default_channel_config() -> UserConfig {
25822582
// It now defaults to 1, so we simply set it to the expected value here.
25832583
default_config.channel_handshake_config.our_htlc_minimum_msat = 1000;
25842584
// When most of our tests were written, we didn't have the notion of a `max_dust_htlc_exposure_msat`,
2585-
// It now defaults to 5_000_000 msat; to avoid interfering with tests we bump it to 50_000_000 msat.
2586-
default_config.channel_config.max_dust_htlc_exposure_msat = 50_000_000;
2585+
// to avoid interfering with tests we bump it to 50_000_000 msat (assuming the default test
2586+
// feerate of 253).
2587+
default_config.channel_config.max_dust_htlc_exposure =
2588+
MaxDustHTLCExposure::FeeRateMultiplier(50_000_000 / 253);
25872589
default_config
25882590
}
25892591

lightning/src/ln/functional_tests.rs

Lines changed: 43 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ use crate::util::test_utils;
3535
use crate::util::errors::APIError;
3636
use crate::util::ser::{Writeable, ReadableArgs};
3737
use crate::util::string::UntrustedString;
38-
use crate::util::config::UserConfig;
38+
use crate::util::config::{UserConfig, MaxDustHTLCExposure};
3939

4040
use bitcoin::hash_types::BlockHash;
4141
use bitcoin::blockdata::script::{Builder, Script};
@@ -9515,7 +9515,7 @@ enum ExposureEvent {
95159515
AtUpdateFeeOutbound,
95169516
}
95179517

9518-
fn do_test_max_dust_htlc_exposure(dust_outbound_balance: bool, exposure_breach_event: ExposureEvent, on_holder_tx: bool) {
9518+
fn do_test_max_dust_htlc_exposure(dust_outbound_balance: bool, exposure_breach_event: ExposureEvent, on_holder_tx: bool, multiplier_dust_limit: bool) {
95199519
// Test that we properly reject dust HTLC violating our `max_dust_htlc_exposure_msat`
95209520
// policy.
95219521
//
@@ -9530,7 +9530,12 @@ fn do_test_max_dust_htlc_exposure(dust_outbound_balance: bool, exposure_breach_e
95309530

95319531
let chanmon_cfgs = create_chanmon_cfgs(2);
95329532
let mut config = test_default_channel_config();
9533-
config.channel_config.max_dust_htlc_exposure_msat = 5_000_000; // default setting value
9533+
config.channel_config.max_dust_htlc_exposure = if multiplier_dust_limit {
9534+
// Default test fee estimator rate is 253 sat/kw, so we set the multiplier to 5_000_000 / 253
9535+
// to get roughly the same initial value as the default setting when this test was
9536+
// originally written.
9537+
MaxDustHTLCExposure::FeeRateMultiplier(5_000_000 / 253)
9538+
} else { MaxDustHTLCExposure::FixedLimitMsat(5_000_000) }; // initial default setting value
95349539
let node_cfgs = create_node_cfgs(2, &chanmon_cfgs);
95359540
let node_chanmgrs = create_node_chanmgrs(2, &node_cfgs, &[Some(config), None]);
95369541
let mut nodes = create_network(2, &node_cfgs, &node_chanmgrs);
@@ -9574,20 +9579,21 @@ fn do_test_max_dust_htlc_exposure(dust_outbound_balance: bool, exposure_breach_e
95749579
let (mut route, payment_hash, _, payment_secret) =
95759580
get_route_and_payment_hash!(nodes[0], nodes[1], 1000);
95769581

9577-
let dust_buffer_feerate = {
9582+
let (dust_buffer_feerate, max_dust_htlc_exposure_msat) = {
95789583
let per_peer_state = nodes[0].node.per_peer_state.read().unwrap();
95799584
let chan_lock = per_peer_state.get(&nodes[1].node.get_our_node_id()).unwrap().lock().unwrap();
95809585
let chan = chan_lock.channel_by_id.get(&channel_id).unwrap();
9581-
chan.context.get_dust_buffer_feerate(None) as u64
9586+
(chan.context.get_dust_buffer_feerate(None) as u64,
9587+
chan.context.get_max_dust_htlc_exposure_msat(&LowerBoundedFeeEstimator(nodes[0].fee_estimator)))
95829588
};
95839589
let dust_outbound_htlc_on_holder_tx_msat: u64 = (dust_buffer_feerate * htlc_timeout_tx_weight(&channel_type_features) / 1000 + open_channel.dust_limit_satoshis - 1) * 1000;
9584-
let dust_outbound_htlc_on_holder_tx: u64 = config.channel_config.max_dust_htlc_exposure_msat / dust_outbound_htlc_on_holder_tx_msat;
9590+
let dust_outbound_htlc_on_holder_tx: u64 = max_dust_htlc_exposure_msat / dust_outbound_htlc_on_holder_tx_msat;
95859591

95869592
let dust_inbound_htlc_on_holder_tx_msat: u64 = (dust_buffer_feerate * htlc_success_tx_weight(&channel_type_features) / 1000 + open_channel.dust_limit_satoshis - 1) * 1000;
9587-
let dust_inbound_htlc_on_holder_tx: u64 = config.channel_config.max_dust_htlc_exposure_msat / dust_inbound_htlc_on_holder_tx_msat;
9593+
let dust_inbound_htlc_on_holder_tx: u64 = max_dust_htlc_exposure_msat / dust_inbound_htlc_on_holder_tx_msat;
95889594

95899595
let dust_htlc_on_counterparty_tx: u64 = 4;
9590-
let dust_htlc_on_counterparty_tx_msat: u64 = config.channel_config.max_dust_htlc_exposure_msat / dust_htlc_on_counterparty_tx;
9596+
let dust_htlc_on_counterparty_tx_msat: u64 = max_dust_htlc_exposure_msat / dust_htlc_on_counterparty_tx;
95919597

95929598
if on_holder_tx {
95939599
if dust_outbound_balance {
@@ -9639,7 +9645,7 @@ fn do_test_max_dust_htlc_exposure(dust_outbound_balance: bool, exposure_breach_e
96399645
), true, APIError::ChannelUnavailable { .. }, {});
96409646
}
96419647
} else if exposure_breach_event == ExposureEvent::AtHTLCReception {
9642-
let (route, payment_hash, _, payment_secret) = get_route_and_payment_hash!(nodes[1], nodes[0], if on_holder_tx { dust_inbound_htlc_on_holder_tx_msat } else { dust_htlc_on_counterparty_tx_msat + 1 });
9648+
let (route, payment_hash, _, payment_secret) = get_route_and_payment_hash!(nodes[1], nodes[0], if on_holder_tx { dust_inbound_htlc_on_holder_tx_msat } else { dust_htlc_on_counterparty_tx_msat + 4 });
96439649
nodes[1].node.send_payment_with_route(&route, payment_hash,
96449650
RecipientOnionFields::secret_only(payment_secret), PaymentId(payment_hash.0)).unwrap();
96459651
check_added_monitors!(nodes[1], 1);
@@ -9652,18 +9658,24 @@ fn do_test_max_dust_htlc_exposure(dust_outbound_balance: bool, exposure_breach_e
96529658
// Outbound dust balance: 6399 sats
96539659
let dust_inbound_overflow = dust_inbound_htlc_on_holder_tx_msat * (dust_inbound_htlc_on_holder_tx + 1);
96549660
let dust_outbound_overflow = dust_outbound_htlc_on_holder_tx_msat * dust_outbound_htlc_on_holder_tx + dust_inbound_htlc_on_holder_tx_msat;
9655-
nodes[0].logger.assert_log("lightning::ln::channel".to_string(), format!("Cannot accept value that would put our exposure to dust HTLCs at {} over the limit {} on holder commitment tx", if dust_outbound_balance { dust_outbound_overflow } else { dust_inbound_overflow }, config.channel_config.max_dust_htlc_exposure_msat), 1);
9661+
nodes[0].logger.assert_log("lightning::ln::channel".to_string(), format!("Cannot accept value that would put our exposure to dust HTLCs at {} over the limit {} on holder commitment tx", if dust_outbound_balance { dust_outbound_overflow } else { dust_inbound_overflow }, max_dust_htlc_exposure_msat), 1);
96569662
} else {
96579663
// Outbound dust balance: 5200 sats
96589664
nodes[0].logger.assert_log("lightning::ln::channel".to_string(),
96599665
format!("Cannot accept value that would put our exposure to dust HTLCs at {} over the limit {} on counterparty commitment tx",
9660-
dust_htlc_on_counterparty_tx_msat * (dust_htlc_on_counterparty_tx - 1) + dust_htlc_on_counterparty_tx_msat + 1,
9661-
config.channel_config.max_dust_htlc_exposure_msat), 1);
9666+
dust_htlc_on_counterparty_tx_msat * (dust_htlc_on_counterparty_tx - 1) + dust_htlc_on_counterparty_tx_msat + 4,
9667+
max_dust_htlc_exposure_msat), 1);
96629668
}
96639669
} else if exposure_breach_event == ExposureEvent::AtUpdateFeeOutbound {
96649670
route.paths[0].hops.last_mut().unwrap().fee_msat = 2_500_000;
9665-
nodes[0].node.send_payment_with_route(&route, payment_hash,
9666-
RecipientOnionFields::secret_only(payment_secret), PaymentId(payment_hash.0)).unwrap();
9671+
// For the multiplier dust exposure limit, since it scales with feerate,
9672+
// we need to add a lot of HTLCs that will become dust at the new feerate
9673+
// to cross the threshold.
9674+
for _ in 0..20 {
9675+
let (_, payment_hash, payment_secret) = get_payment_preimage_hash(&nodes[1], Some(1_000), None);
9676+
nodes[0].node.send_payment_with_route(&route, payment_hash,
9677+
RecipientOnionFields::secret_only(payment_secret), PaymentId(payment_hash.0)).unwrap();
9678+
}
96679679
{
96689680
let mut feerate_lock = chanmon_cfgs[0].fee_estimator.sat_per_kw.lock().unwrap();
96699681
*feerate_lock = *feerate_lock * 10;
@@ -9678,20 +9690,25 @@ fn do_test_max_dust_htlc_exposure(dust_outbound_balance: bool, exposure_breach_e
96789690
added_monitors.clear();
96799691
}
96809692

9693+
fn do_test_max_dust_htlc_exposure_by_threshold_type(multiplier_dust_limit: bool) {
9694+
do_test_max_dust_htlc_exposure(true, ExposureEvent::AtHTLCForward, true, multiplier_dust_limit);
9695+
do_test_max_dust_htlc_exposure(false, ExposureEvent::AtHTLCForward, true, multiplier_dust_limit);
9696+
do_test_max_dust_htlc_exposure(false, ExposureEvent::AtHTLCReception, true, multiplier_dust_limit);
9697+
do_test_max_dust_htlc_exposure(false, ExposureEvent::AtHTLCReception, false, multiplier_dust_limit);
9698+
do_test_max_dust_htlc_exposure(true, ExposureEvent::AtHTLCForward, false, multiplier_dust_limit);
9699+
do_test_max_dust_htlc_exposure(true, ExposureEvent::AtHTLCReception, false, multiplier_dust_limit);
9700+
do_test_max_dust_htlc_exposure(true, ExposureEvent::AtHTLCReception, true, multiplier_dust_limit);
9701+
do_test_max_dust_htlc_exposure(false, ExposureEvent::AtHTLCForward, false, multiplier_dust_limit);
9702+
do_test_max_dust_htlc_exposure(true, ExposureEvent::AtUpdateFeeOutbound, true, multiplier_dust_limit);
9703+
do_test_max_dust_htlc_exposure(true, ExposureEvent::AtUpdateFeeOutbound, false, multiplier_dust_limit);
9704+
do_test_max_dust_htlc_exposure(false, ExposureEvent::AtUpdateFeeOutbound, false, multiplier_dust_limit);
9705+
do_test_max_dust_htlc_exposure(false, ExposureEvent::AtUpdateFeeOutbound, true, multiplier_dust_limit);
9706+
}
9707+
96819708
#[test]
96829709
fn test_max_dust_htlc_exposure() {
9683-
do_test_max_dust_htlc_exposure(true, ExposureEvent::AtHTLCForward, true);
9684-
do_test_max_dust_htlc_exposure(false, ExposureEvent::AtHTLCForward, true);
9685-
do_test_max_dust_htlc_exposure(false, ExposureEvent::AtHTLCReception, true);
9686-
do_test_max_dust_htlc_exposure(false, ExposureEvent::AtHTLCReception, false);
9687-
do_test_max_dust_htlc_exposure(true, ExposureEvent::AtHTLCForward, false);
9688-
do_test_max_dust_htlc_exposure(true, ExposureEvent::AtHTLCReception, false);
9689-
do_test_max_dust_htlc_exposure(true, ExposureEvent::AtHTLCReception, true);
9690-
do_test_max_dust_htlc_exposure(false, ExposureEvent::AtHTLCForward, false);
9691-
do_test_max_dust_htlc_exposure(true, ExposureEvent::AtUpdateFeeOutbound, true);
9692-
do_test_max_dust_htlc_exposure(true, ExposureEvent::AtUpdateFeeOutbound, false);
9693-
do_test_max_dust_htlc_exposure(false, ExposureEvent::AtUpdateFeeOutbound, false);
9694-
do_test_max_dust_htlc_exposure(false, ExposureEvent::AtUpdateFeeOutbound, true);
9710+
do_test_max_dust_htlc_exposure_by_threshold_type(false);
9711+
do_test_max_dust_htlc_exposure_by_threshold_type(true);
96959712
}
96969713

96979714
#[test]

lightning/src/ln/onion_route_tests.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use crate::ln::msgs::{ChannelMessageHandler, ChannelUpdate};
2626
use crate::ln::wire::Encode;
2727
use crate::util::ser::{Writeable, Writer};
2828
use crate::util::test_utils;
29-
use crate::util::config::{UserConfig, ChannelConfig};
29+
use crate::util::config::{UserConfig, ChannelConfig, MaxDustHTLCExposure};
3030
use crate::util::errors::APIError;
3131

3232
use bitcoin::hash_types::BlockHash;
@@ -671,6 +671,7 @@ fn do_test_onion_failure_stale_channel_update(announced_channel: bool) {
671671
config.channel_handshake_config.announced_channel = announced_channel;
672672
config.channel_handshake_limits.force_announced_channel_preference = false;
673673
config.accept_forwards_to_priv_channels = !announced_channel;
674+
config.channel_config.max_dust_htlc_exposure = MaxDustHTLCExposure::FeeRateMultiplier(5_000_000 / 253);
674675
let chanmon_cfgs = create_chanmon_cfgs(3);
675676
let persister;
676677
let chain_monitor;
@@ -1371,10 +1372,19 @@ fn test_phantom_failure_too_low_recv_amt() {
13711372

13721373
#[test]
13731374
fn test_phantom_dust_exposure_failure() {
1375+
do_test_phantom_dust_exposure_failure(false);
1376+
do_test_phantom_dust_exposure_failure(true);
1377+
}
1378+
1379+
fn do_test_phantom_dust_exposure_failure(multiplier_dust_limit: bool) {
13741380
// Set the max dust exposure to the dust limit.
13751381
let max_dust_exposure = 546;
13761382
let mut receiver_config = UserConfig::default();
1377-
receiver_config.channel_config.max_dust_htlc_exposure_msat = max_dust_exposure;
1383+
// Default test fee estimator rate is 253, so to set the max dust exposure to the dust limit,
1384+
// we need to set the multiplier to 2.
1385+
receiver_config.channel_config.max_dust_htlc_exposure =
1386+
if multiplier_dust_limit { MaxDustHTLCExposure::FeeRateMultiplier(2) }
1387+
else { MaxDustHTLCExposure::FixedLimitMsat(max_dust_exposure) };
13781388
receiver_config.channel_handshake_config.announced_channel = true;
13791389

13801390
let chanmon_cfgs = create_chanmon_cfgs(2);

0 commit comments

Comments
 (0)