@@ -1243,28 +1243,26 @@ where L::Target: Logger {
1243
1243
// around again with a higher amount.
1244
1244
if !contributes_sufficient_value || exceeds_max_path_length ||
1245
1245
exceeds_cltv_delta_limit || payment_failed_on_this_channel {
1246
+
1247
+ let logger_test = crate :: util:: test_utils:: TestLogger :: new( ) ;
1246
1248
let mut is_first_hop = true ;
1247
- // if let Some(target) = first_hop_targets.get(&NodeId::from_pubkey(&our_node_pubkey)) {
1248
- for ( key , value) in & first_hop_targets {
1249
- if ( key == & NodeId :: from_pubkey( & our_node_pubkey) ) {
1250
- for channel_details in value {
1251
- if let Some ( short_channel_id_target) = channel_details. short_channel_id{
1252
- if short_channel_id_target == short_channel_id { // short_channel_id is hop id of candidate.
1253
- if is_first_hop && !contributes_sufficient_value {
1254
- log_trace!( logger, "First Hop {short_channel_id} is excluded due to insufficient value" ) ;
1255
- } else if is_first_hop && exceeds_max_path_length {
1256
- log_trace!( logger, "First Hop {short_channel_id} is excluded due to candidate hop excluded max path length" ) ;
1257
- } else if is_first_hop && exceeds_cltv_delta_limit {
1258
- log_trace!( logger, "First Hop {short_channel_id} is excluded beacause it exceed the maximum total cltv expiry limit" ) ;
1259
- } else if is_first_hop && payment_failed_on_this_channel {
1260
- log_trace!( logger, "First Hop {short_channel_id} is excluded beacause it was failed previously" ) ;
1261
- }
1262
- is_first_hop = false ;
1263
- }
1264
- }
1265
- }
1266
- }
1267
- }
1249
+ for ( key , _channel) in & first_hop_targets {
1250
+ if key == & $dest_node_id {
1251
+ if is_first_hop && !contributes_sufficient_value {
1252
+ log_trace!( logger, "First Hop {} is excluded due to insufficient value" , short_channel_id) ;
1253
+
1254
+ } else if is_first_hop && exceeds_max_path_length {
1255
+ log_trace!( logger, "First Hop {} is excluded due to candidate hop excluded max path length" , short_channel_id) ;
1256
+
1257
+ } else if is_first_hop && exceeds_cltv_delta_limit {
1258
+ log_trace!( logger, "First Hop {} is excluded beacause it exceed the maximum total cltv expiry limit" , short_channel_id) ;
1259
+
1260
+ } else if is_first_hop && payment_failed_on_this_channel {
1261
+ log_trace!( logger, "First Hop {} is excluded beacause it was failed previously" , short_channel_id) ;
1262
+ }
1263
+ is_first_hop = false ;
1264
+ } // commit
1265
+ }
1268
1266
// Path isn't useful, ignore it and move on.
1269
1267
} else if may_overpay_to_meet_path_minimum_msat {
1270
1268
hit_minimum_limit = true ;
0 commit comments