File tree 1 file changed +3
-5
lines changed
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>(
1772
1772
network_graph : & ReadOnlyNetworkGraph , final_value_msat : u64 , final_cltv_expiry_delta : u32 ,
1773
1773
logger : L , random_seed_bytes : & [ u8 ; 32 ] ) -> Result < Route , LightningError > where L :: Target : Logger {
1774
1774
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
-
1778
1775
let filter_by_nodeids = |_short_channel_id : u64 , _send_amt_msat : u64 , _capacity_msat : u64 ,
1779
1776
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 ( ) {
1782
1780
0
1783
1781
} else {
1784
1782
u64:: max_value ( )
You can’t perform that action at this time.
0 commit comments