Skip to content

Commit 4512eff

Browse files
f don't count blinded hops towards max path len
1 parent e93cc70 commit 4512eff

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

lightning/src/routing/router.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1419,12 +1419,6 @@ impl<'a> CandidateRouteHop<'a> {
14191419
_ => None,
14201420
}
14211421
}
1422-
fn is_one_hop_blinded_path(&self) -> bool {
1423-
match self {
1424-
Self::OneHopBlinded(_) => true,
1425-
_ => false,
1426-
}
1427-
}
14281422
/// Returns the source node id of current hop.
14291423
///
14301424
/// Source node id refers to the node forwarding the HTLC through this hop.
@@ -2163,7 +2157,7 @@ where L::Target: Logger {
21632157
let contributes_sufficient_value = available_value_contribution_msat >= minimal_value_contribution_msat;
21642158
// Do not consider candidate hops that would exceed the maximum path length.
21652159
let path_length_to_node = $next_hops_path_length
2166-
+ if $candidate.is_one_hop_blinded_path() { 0 } else { 1 };
2160+
+ if $candidate.blinded_hint_idx().is_some() { 0 } else { 1 };
21672161
let exceeds_max_path_length = path_length_to_node > max_path_length;
21682162

21692163
// Do not consider candidates that exceed the maximum total cltv expiry limit.
@@ -2619,8 +2613,7 @@ where L::Target: Logger {
26192613
let path_min = candidate.htlc_minimum_msat().saturating_add(
26202614
compute_fees_saturating(candidate.htlc_minimum_msat(), candidate.fees()));
26212615
add_entry!(&first_hop_candidate, blinded_path_fee, path_contribution_msat, path_min,
2622-
0_u64, candidate.cltv_expiry_delta(),
2623-
candidate.blinded_path().map_or(0, |path| path.blinded_hops.len().saturating_sub(1)) as u8);
2616+
0_u64, candidate.cltv_expiry_delta(), 0);
26242617
}
26252618
}
26262619
}

0 commit comments

Comments
 (0)