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 @@ -1772,13 +1772,11 @@ fn build_route_from_hops_internal<L: Deref>(
17721772 network_graph : & ReadOnlyNetworkGraph , final_value_msat : u64 , final_cltv_expiry_delta : u32 ,
17731773 logger : L , random_seed_bytes : & [ u8 ; 32 ] ) -> Result < Route , LightningError > where L :: Target : Logger {
17741774
1775- let hop_ids: Vec < NodeId > = core:: iter:: once ( NodeId :: from_pubkey ( & our_node_pubkey) )
1776- . chain ( hops. iter ( ) . map ( |hop_pubkey| NodeId :: from_pubkey ( & hop_pubkey) ) ) . collect ( ) ;
1777-
17781775 let filter_by_nodeids = |_short_channel_id : u64 , _send_amt_msat : u64 , _capacity_msat : u64 ,
17791776 source : & NodeId , target : & NodeId | {
1780- if hop_ids. iter ( ) . find ( |x| * * x == * source) . is_some ( )
1781- && hop_ids. iter ( ) . find ( |x| * * x == * target) . is_some ( ) {
1777+ let mut hop_iter = core:: iter:: once ( NodeId :: from_pubkey ( & our_node_pubkey) ) . chain ( hops. iter ( ) . map ( |hop_pubkey| NodeId :: from_pubkey ( & hop_pubkey) ) ) ;
1778+ if hop_iter. clone ( ) . find ( |x| * x == * source) . is_some ( )
1779+ && hop_iter. find ( |x| * x == * target) . is_some ( ) {
17821780 0
17831781 } else {
17841782 u64:: max_value ( )
You can’t perform that action at this time.
0 commit comments