@@ -1054,6 +1054,14 @@ impl<'a> CandidateRouteHop<'a> {
1054
1054
_ => CandidateHopId :: Clear ( ( self . short_channel_id ( ) . unwrap ( ) , channel_direction) ) ,
1055
1055
}
1056
1056
}
1057
+ fn blinded_path ( & self ) -> Option < & ' a BlindedPath > {
1058
+ match self {
1059
+ CandidateRouteHop :: Blinded { hint, .. } | CandidateRouteHop :: OneHopBlinded { hint, .. } => {
1060
+ Some ( & hint. 1 )
1061
+ } ,
1062
+ _ => None ,
1063
+ }
1064
+ }
1057
1065
}
1058
1066
1059
1067
#[ derive( Eq , Hash , PartialEq ) ]
@@ -1968,7 +1976,9 @@ where L::Target: Logger {
1968
1976
first_hop_targets. get ( & intro_node_id) . is_some ( ) ||
1969
1977
network_nodes. get ( & intro_node_id) . is_some ( ) ;
1970
1978
if !have_intro_node_in_graph { continue }
1971
- let candidate = CandidateRouteHop :: Blinded { hint, hint_idx } ;
1979
+ let candidate = if hint. 1 . blinded_hops . len ( ) == 1 {
1980
+ CandidateRouteHop :: OneHopBlinded { hint, hint_idx }
1981
+ } else { CandidateRouteHop :: Blinded { hint, hint_idx } } ;
1972
1982
let mut path_contribution_msat = path_value_msat;
1973
1983
if let Some ( hop_used_msat) = add_entry ! ( candidate, intro_node_id, maybe_dummy_payee_node_id,
1974
1984
0 , path_contribution_msat, 0 , 0_u64 , 0 , 0 )
@@ -2401,11 +2411,11 @@ where L::Target: Logger {
2401
2411
}
2402
2412
let mut final_cltv_delta = final_cltv_expiry_delta;
2403
2413
let blinded_tail = payment_path. hops . last ( ) . map ( |( h, _) | {
2404
- if let CandidateRouteHop :: Blinded { hint , .. } = h. candidate {
2414
+ if let Some ( blinded_path ) = h. candidate . blinded_path ( ) {
2405
2415
final_cltv_delta = h. candidate . cltv_expiry_delta ( ) ;
2406
2416
Some ( BlindedTail {
2407
- hops : hint . 1 . blinded_hops . clone ( ) ,
2408
- blinding_point : hint . 1 . blinding_point ,
2417
+ hops : blinded_path . blinded_hops . clone ( ) ,
2418
+ blinding_point : blinded_path . blinding_point ,
2409
2419
excess_final_cltv_expiry_delta : 0 ,
2410
2420
final_value_msat : h. fee_msat ,
2411
2421
} )
0 commit comments