Skip to content

Commit 01779e8

Browse files
committed
f avoid consts for feerate
1 parent 1d98aa5 commit 01779e8

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

lightning/src/ln/functional_tests.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1392,9 +1392,7 @@ fn test_chan_reserve_violation_outbound_htlc_inbound_chan() {
13921392
// sending any above-dust amount would result in a channel reserve violation.
13931393
// In this test we check that we would be prevented from sending an HTLC in
13941394
// this situation.
1395-
let feerate_per_kw = 253;
1396-
chanmon_cfgs[0].fee_estimator = test_utils::TestFeeEstimator { sat_per_kw: Mutex::new(feerate_per_kw) };
1397-
chanmon_cfgs[1].fee_estimator = test_utils::TestFeeEstimator { sat_per_kw: Mutex::new(feerate_per_kw) };
1395+
let feerate_per_kw = *chanmon_cfgs[0].fee_estimator.sat_per_kw.lock().unwrap();
13981396
let node_cfgs = create_node_cfgs(2, &chanmon_cfgs);
13991397
let node_chanmgrs = create_node_chanmgrs(2, &node_cfgs, &[None, None]);
14001398
let mut nodes = create_network(2, &node_cfgs, &node_chanmgrs);
@@ -1422,7 +1420,7 @@ fn test_chan_reserve_violation_outbound_htlc_inbound_chan() {
14221420
#[test]
14231421
fn test_chan_reserve_violation_inbound_htlc_outbound_channel() {
14241422
let mut chanmon_cfgs = create_chanmon_cfgs(2);
1425-
let feerate_per_kw = 253;
1423+
let feerate_per_kw = *chanmon_cfgs[0].fee_estimator.sat_per_kw.lock().unwrap();
14261424
let node_cfgs = create_node_cfgs(2, &chanmon_cfgs);
14271425
let node_chanmgrs = create_node_chanmgrs(2, &node_cfgs, &[None, None]);
14281426
let mut nodes = create_network(2, &node_cfgs, &node_chanmgrs);
@@ -1473,9 +1471,7 @@ fn test_chan_reserve_dust_inbound_htlcs_outbound_chan() {
14731471
// Test that if we receive many dust HTLCs over an outbound channel, they don't count when
14741472
// calculating our commitment transaction fee (this was previously broken).
14751473
let mut chanmon_cfgs = create_chanmon_cfgs(2);
1476-
let feerate_per_kw = 253;
1477-
chanmon_cfgs[0].fee_estimator = test_utils::TestFeeEstimator { sat_per_kw: Mutex::new(feerate_per_kw) };
1478-
chanmon_cfgs[1].fee_estimator = test_utils::TestFeeEstimator { sat_per_kw: Mutex::new(feerate_per_kw) };
1474+
let feerate_per_kw = *chanmon_cfgs[0].fee_estimator.sat_per_kw.lock().unwrap();
14791475

14801476
let node_cfgs = create_node_cfgs(2, &chanmon_cfgs);
14811477
let node_chanmgrs = create_node_chanmgrs(2, &node_cfgs, &[None, None, None]);

0 commit comments

Comments
 (0)