File tree Expand file tree Collapse file tree 1 file changed +8
-13
lines changed Expand file tree Collapse file tree 1 file changed +8
-13
lines changed Original file line number Diff line number Diff line change @@ -1810,21 +1810,16 @@ 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-
1814- let node_ids_iter = hops. iter ( ) . map ( |hop_pubkey| NodeId :: from_pubkey ( & hop_pubkey) ) ;
1815- let mut hop_iter = core:: iter:: once ( NodeId :: from_pubkey ( & our_node_pubkey) )
1816- . chain ( node_ids_iter. clone ( ) )
1817- . zip ( node_ids_iter) ;
1818-
1819- match hop_iter. find ( |( cur_id, next_id) | {
1820- ( * cur_id == * source && * next_id == * target) ||
1821- ( * cur_id == * target && * next_id == * source) } )
1822- {
1823- Some ( _) => 0 ,
1824- None => u64:: max_value ( )
1825- }
1813+ let node_ids_iter = hops. iter ( ) . map ( |hop_pubkey| NodeId :: from_pubkey ( & hop_pubkey) ) ;
1814+ let hop_iter = core:: iter:: once ( NodeId :: from_pubkey ( & our_node_pubkey) )
1815+ . chain ( node_ids_iter. clone ( ) )
1816+ . zip ( node_ids_iter) ;
18261817 let filter_channels = |_short_channel_id : u64 , source : & NodeId , target : & NodeId ,
18271818 _usage : ChannelUsage | {
1819+ match hop_iter. clone ( ) . find ( |( cur_id, next_id) | { * cur_id == * source && * next_id == * target } ) {
1820+ Some ( _) => 0 ,
1821+ None => u64:: max_value ( )
1822+ }
18281823 } ;
18291824
18301825 let scorer = DynamicPenaltyScorer :: with_penalty_func ( filter_channels) ;
You can’t perform that action at this time.
0 commit comments