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>(
1810
1810
network_graph : & ReadOnlyNetworkGraph , final_value_msat : u64 , final_cltv_expiry_delta : u32 ,
1811
1811
logger : L , random_seed_bytes : & [ u8 ; 32 ] ) -> Result < Route , LightningError > where L :: Target : Logger {
1812
1812
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
-
1816
1813
let filter_by_nodeids = |_short_channel_id : u64 , _send_amt_msat : u64 , _capacity_msat : u64 ,
1817
1814
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 ( ) {
1820
1818
0
1821
1819
} else {
1822
1820
u64:: max_value ( )
You can’t perform that action at this time.
0 commit comments