Skip to content

Commit 4b900b7

Browse files
committed
Simplify test_fail_holding_cell_htlc_upon_free_multihop somewhat
In the coming commits we redo our next-HTLC-available logic which requires some minor test changes for tests which relied on calculating routes which were not usable. Here we do a minor prefactor to simplify a test which now no longer requires later changes.
1 parent 2290141 commit 4b900b7

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

lightning/src/ln/functional_tests.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5878,10 +5878,10 @@ fn test_free_and_fail_holding_cell_htlcs() {
58785878
fn test_fail_holding_cell_htlc_upon_free_multihop() {
58795879
let chanmon_cfgs = create_chanmon_cfgs(3);
58805880
let node_cfgs = create_node_cfgs(3, &chanmon_cfgs);
5881-
// When this test was written, the default base fee floated based on the HTLC count.
5882-
// It is now fixed, so we simply set the fee to the expected value here.
5881+
// Avoid having to include routing fees in calculations
58835882
let mut config = test_default_channel_config();
5884-
config.channel_config.forwarding_fee_base_msat = 196;
5883+
config.channel_config.forwarding_fee_base_msat = 0;
5884+
config.channel_config.forwarding_fee_proportional_millionths = 0;
58855885
let node_chanmgrs = create_node_chanmgrs(3, &node_cfgs, &[Some(config.clone()), Some(config.clone()), Some(config.clone())]);
58865886
let mut nodes = create_network(3, &node_cfgs, &node_chanmgrs);
58875887
let chan_0_1 = create_announced_chan_between_nodes_with_value(&nodes, 0, 1, 100000, 95000000);
@@ -5913,9 +5913,7 @@ fn test_fail_holding_cell_htlc_upon_free_multihop() {
59135913
let opt_anchors = get_opt_anchors!(nodes[0], nodes[1], chan_0_1.2);
59145914

59155915
// Send a payment which passes reserve checks but gets stuck in the holding cell.
5916-
let feemsat = 239;
5917-
let total_routing_fee_msat = (nodes.len() - 2) as u64 * feemsat;
5918-
let max_can_send = 5000000 - channel_reserve - 2*commit_tx_fee_msat(feerate, 1 + 1, opt_anchors) - total_routing_fee_msat;
5916+
let max_can_send = 5000000 - channel_reserve - 2*commit_tx_fee_msat(feerate, 1 + 1, opt_anchors);
59195917
let (route, our_payment_hash, _, our_payment_secret) = get_route_and_payment_hash!(nodes[0], nodes[2], max_can_send);
59205918
let payment_event = {
59215919
nodes[0].node.send_payment_with_route(&route, our_payment_hash,

0 commit comments

Comments
 (0)