@@ -2107,12 +2107,13 @@ where L::Target: Logger {
21072107 for ( hint_idx, hint) in payment_params. payee . blinded_route_hints ( ) . iter ( ) . enumerate ( ) {
21082108 let intro_node_id = NodeId :: from_pubkey ( & hint. 1 . introduction_node_id ) ;
21092109 let have_intro_node_in_graph =
2110- // Only add the hops in this route to our candidate set if either
2111- // we have a direct channel to the first hop or the first hop is
2112- // in the regular network graph.
2110+ // Only add the hops in this route to our candidate set if either we are part of
2111+ // the first hop, we have a direct channel to the first hop, or the first hop is in
2112+ // the regular network graph.
2113+ our_node_id == intro_node_id ||
21132114 first_hop_targets. get ( & intro_node_id) . is_some ( ) ||
21142115 network_nodes. get ( & intro_node_id) . is_some ( ) ;
2115- if !have_intro_node_in_graph || our_node_id == intro_node_id { continue }
2116+ if !have_intro_node_in_graph { continue }
21162117 let candidate = if hint. 1 . blinded_hops . len ( ) == 1 {
21172118 CandidateRouteHop :: OneHopBlinded { hint, hint_idx }
21182119 } else { CandidateRouteHop :: Blinded { hint, hint_idx } } ;
@@ -2143,12 +2144,14 @@ where L::Target: Logger {
21432144 . filter ( |route| !route. 0 . is_empty ( ) )
21442145 {
21452146 let first_hop_in_route = & ( route. 0 ) [ 0 ] ;
2147+ let first_hop_src_id = NodeId :: from_pubkey ( & first_hop_in_route. src_node_id ) ;
21462148 let have_hop_src_in_graph =
2147- // Only add the hops in this route to our candidate set if either
2148- // we have a direct channel to the first hop or the first hop is
2149- // in the regular network graph.
2150- first_hop_targets. get ( & NodeId :: from_pubkey ( & first_hop_in_route. src_node_id ) ) . is_some ( ) ||
2151- network_nodes. get ( & NodeId :: from_pubkey ( & first_hop_in_route. src_node_id ) ) . is_some ( ) ;
2149+ // Only add the hops in this route to our candidate set if either we are part of
2150+ // the first hop, we have a direct channel to the first hop, or the first hop is in
2151+ // the regular network graph.
2152+ our_node_id == first_hop_src_id ||
2153+ first_hop_targets. get ( & first_hop_src_id) . is_some ( ) ||
2154+ network_nodes. get ( & first_hop_src_id) . is_some ( ) ;
21522155 if have_hop_src_in_graph {
21532156 // We start building the path from reverse, i.e., from payee
21542157 // to the first RouteHintHop in the path.
0 commit comments