Skip to content

Commit 9339454

Browse files
Fix flaky route blinding test.
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.
1 parent 2809ad7 commit 9339454

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lightning/src/ln/blinded_payment_tests.rs

+2
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,8 @@ fn three_hop_blinded_path_success() {
510510
create_announced_chan_between_nodes_with_value(&nodes, 1, 2, 1_000_000, 0);
511511
let chan_upd_2_3 = create_announced_chan_between_nodes_with_value(&nodes, 2, 3, 1_000_000, 0).0.contents;
512512
let chan_upd_3_4 = create_announced_chan_between_nodes_with_value(&nodes, 3, 4, 1_000_000, 0).0.contents;
513+
// Make sure the nodes are on a similar height so nodes[0] sets a valid CLTV expiry.
514+
connect_blocks(&nodes[0], nodes[4].best_block_info().1 - nodes[0].best_block_info().1);
513515

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

0 commit comments

Comments
 (0)