mirror of
https://github.com/lightningdevkit/rust-lightning.git
synced 2025-02-25 15:20:24 +01:00
Fix three_hop_blinded_path_success
with different randomization
In `three_hop_blinded_path_success`, the nodes in the test ended up at radically different block heights after channel opening. At that point, if the CLTV randomization is done slightly different the test payment may fail, which we fix here by ensuring all nodes are at the same height before we go to send a payment.
This commit is contained in:
parent
a5ba3391f8
commit
3716227359
1 changed files with 6 additions and 0 deletions
|
@ -509,6 +509,12 @@ fn three_hop_blinded_path_success() {
|
|||
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;
|
||||
|
||||
// Get all our nodes onto the same height so payments don't fail for CLTV violations.
|
||||
connect_blocks(&nodes[0], nodes[4].best_block_info().1 - nodes[0].best_block_info().1);
|
||||
connect_blocks(&nodes[1], nodes[4].best_block_info().1 - nodes[1].best_block_info().1);
|
||||
connect_blocks(&nodes[2], nodes[4].best_block_info().1 - nodes[2].best_block_info().1);
|
||||
assert_eq!(nodes[4].best_block_info().1, nodes[3].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);
|
||||
let route_params = get_blinded_route_parameters(amt_msat, payment_secret,
|
||||
|
|
Loading…
Add table
Reference in a new issue