Skip to content

Commit 8637eaf

Browse files
f always add shadow offset to blinded paths
1 parent 742e2ba commit 8637eaf

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

lightning/src/routing/router.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2111,8 +2111,6 @@ fn add_random_cltv_offset(route: &mut Route, payment_params: &PaymentParameters,
21112111
let network_nodes = network_graph.nodes();
21122112

21132113
for path in route.paths.iter_mut() {
2114-
if path.blinded_tail.as_ref().map_or(false, |tail| tail.hops.len() > 1) { continue }
2115-
21162114
let mut shadow_ctlv_expiry_delta_offset: u32 = 0;
21172115

21182116
// Remember the last three nodes of the random walk and avoid looping back on them.
@@ -2184,8 +2182,7 @@ fn add_random_cltv_offset(route: &mut Route, payment_params: &PaymentParameters,
21842182
if let Some(tail) = path.blinded_tail.as_mut() {
21852183
tail.final_cltv_expiry_delta = tail.final_cltv_expiry_delta
21862184
.checked_add(shadow_ctlv_expiry_delta_offset).unwrap_or(tail.final_cltv_expiry_delta);
2187-
}
2188-
if let Some(last_hop) = path.hops.last_mut() {
2185+
} else if let Some(last_hop) = path.hops.last_mut() {
21892186
last_hop.cltv_expiry_delta = last_hop.cltv_expiry_delta
21902187
.checked_add(shadow_ctlv_expiry_delta_offset).unwrap_or(last_hop.cltv_expiry_delta);
21912188
}

0 commit comments

Comments
 (0)