Skip to content

Commit

Permalink
Fix flaky route blinding test.
Browse files Browse the repository at this point in the history
If the RNG used in the test changes, the sender may be adding fewer blocks as
their random shadow offset to the total CLTV expiry. This should be fine,
except in the case of this test the sender has fallen 30 blocks behind the
receiver, causing the CLTV expiry they set to be too low.
  • Loading branch information
valentinewallace committed Jan 26, 2024
1 parent 2809ad7 commit 9339454
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lightning/src/ln/blinded_payment_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,8 @@ fn three_hop_blinded_path_success() {
create_announced_chan_between_nodes_with_value(&nodes, 1, 2, 1_000_000, 0);
let chan_upd_2_3 = create_announced_chan_between_nodes_with_value(&nodes, 2, 3, 1_000_000, 0).0.contents;
let chan_upd_3_4 = create_announced_chan_between_nodes_with_value(&nodes, 3, 4, 1_000_000, 0).0.contents;
// Make sure the nodes are on a similar height so nodes[0] sets a valid CLTV expiry.
connect_blocks(&nodes[0], nodes[4].best_block_info().1 - nodes[0].best_block_info().1);

let amt_msat = 5000;
let (payment_preimage, payment_hash, payment_secret) = get_payment_preimage_hash(&nodes[4], Some(amt_msat), None);
Expand Down

0 comments on commit 9339454

Please sign in to comment.