Skip to content

Commit c57f781

Browse files
committed
f check that each hop is padded in check_dummy_hopd_path_length
1 parent f2c778c commit c57f781

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lightning/src/ln/offers_tests.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,11 @@ fn check_dummy_hopd_path_length<'a, 'b, 'c>(
170170
expected_path_length: usize,
171171
) -> bool {
172172
let introduction_node_id = resolve_introduction_node(lookup_node, path);
173+
let first_hop_len = path.blinded_hops().first().unwrap().encrypted_payload.len();
174+
let hops = path.blinded_hops();
173175
introduction_node_id == expected_introduction_node
174-
&& path.blinded_hops().len() == expected_path_length
176+
&& hops.len() == expected_path_length
177+
&& hops.iter().take(hops.len() - 1).all(|hop| hop.encrypted_payload.len() == first_hop_len)
175178
}
176179

177180
fn route_bolt12_payment<'a, 'b, 'c>(

0 commit comments

Comments
 (0)