@@ -1400,7 +1400,7 @@ fn test_chan_reserve_violation_outbound_htlc_inbound_chan() {
1400
1400
let mut nodes = create_network ( 2 , & node_cfgs, & node_chanmgrs) ;
1401
1401
1402
1402
let mut push_amt = 100_000_000 ;
1403
- push_amt -= feerate_per_kw as u64 * ( COMMITMENT_TX_BASE_WEIGHT + 4 * COMMITMENT_TX_WEIGHT_PER_HTLC ) / 1000 * 1000 ;
1403
+ push_amt -= commit_tx_fee_msat ( feerate_per_kw, 4 ) ;
1404
1404
push_amt -= Channel :: < EnforcingSigner > :: get_holder_selected_channel_reserve_satoshis ( 100_000 ) * 1000 ;
1405
1405
1406
1406
let _ = create_announced_chan_between_nodes_with_value ( & nodes, 0 , 1 , 100_000 , push_amt, InitFeatures :: known ( ) , InitFeatures :: known ( ) ) ;
@@ -1431,7 +1431,7 @@ fn test_chan_reserve_violation_inbound_htlc_outbound_channel() {
1431
1431
// channel reserve violation (so their balance is channel reserve (1000 sats) + commitment
1432
1432
// transaction fee with 0 HTLCs (183 sats)).
1433
1433
let mut push_amt = 100_000_000 ;
1434
- push_amt -= feerate_per_kw as u64 * ( COMMITMENT_TX_BASE_WEIGHT + 4 * COMMITMENT_TX_WEIGHT_PER_HTLC ) / 1000 * 1000 ;
1434
+ push_amt -= commit_tx_fee_msat ( feerate_per_kw, 4 ) ;
1435
1435
push_amt -= Channel :: < EnforcingSigner > :: get_holder_selected_channel_reserve_satoshis ( 100_000 ) * 1000 ;
1436
1436
let chan = create_announced_chan_between_nodes_with_value ( & nodes, 0 , 1 , 100_000 , push_amt, InitFeatures :: known ( ) , InitFeatures :: known ( ) ) ;
1437
1437
@@ -1485,7 +1485,7 @@ fn test_chan_reserve_dust_inbound_htlcs_outbound_chan() {
1485
1485
// channel reserve violation (so their balance is channel reserve (1000 sats) + commitment
1486
1486
// transaction fee with 0 HTLCs (183 sats)).
1487
1487
let mut push_amt = 100_000_000 ;
1488
- push_amt -= feerate_per_kw as u64 * ( COMMITMENT_TX_BASE_WEIGHT + 4 * COMMITMENT_TX_WEIGHT_PER_HTLC ) / 1000 * 1000 ;
1488
+ push_amt -= commit_tx_fee_msat ( feerate_per_kw, 4 ) ;
1489
1489
push_amt -= Channel :: < EnforcingSigner > :: get_holder_selected_channel_reserve_satoshis ( 100_000 ) * 1000 ;
1490
1490
create_announced_chan_between_nodes_with_value ( & nodes, 0 , 1 , 100000 , push_amt, InitFeatures :: known ( ) , InitFeatures :: known ( ) ) ;
1491
1491
0 commit comments