File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -1810,13 +1810,11 @@ fn build_route_from_hops_internal<L: Deref>(
18101810 network_graph : & ReadOnlyNetworkGraph , final_value_msat : u64 , final_cltv_expiry_delta : u32 ,
18111811 logger : L , random_seed_bytes : & [ u8 ; 32 ] ) -> Result < Route , LightningError > where L :: Target : Logger {
18121812
1813- let hop_ids: Vec < NodeId > = core:: iter:: once ( NodeId :: from_pubkey ( & our_node_pubkey) )
1814- . chain ( hops. iter ( ) . map ( |hop_pubkey| NodeId :: from_pubkey ( & hop_pubkey) ) ) . collect ( ) ;
1815-
18161813 let filter_by_nodeids = |_short_channel_id : u64 , _send_amt_msat : u64 , _capacity_msat : u64 ,
18171814 source : & NodeId , target : & NodeId | {
1818- if hop_ids. iter ( ) . find ( |x| * * x == * source) . is_some ( )
1819- && hop_ids. iter ( ) . find ( |x| * * x == * target) . is_some ( ) {
1815+ let mut hop_iter = core:: iter:: once ( NodeId :: from_pubkey ( & our_node_pubkey) ) . chain ( hops. iter ( ) . map ( |hop_pubkey| NodeId :: from_pubkey ( & hop_pubkey) ) ) ;
1816+ if hop_iter. clone ( ) . find ( |x| * x == * source) . is_some ( )
1817+ && hop_iter. find ( |x| * x == * target) . is_some ( ) {
18201818 0
18211819 } else {
18221820 u64:: max_value ( )
You can’t perform that action at this time.
0 commit comments