Skip to content

Commit 7122a58

Browse files
committed
f Log candidates we ignored due to fee limit
1 parent afe80e4 commit 7122a58

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

lightning/src/routing/router.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1668,6 +1668,7 @@ where L::Target: Logger {
16681668
let mut num_ignored_path_length_limit = 0;
16691669
let mut num_ignored_cltv_delta_limit = 0;
16701670
let mut num_ignored_previously_failed = 0;
1671+
let mut num_ignored_total_fee_limit = 0;
16711672

16721673
macro_rules! add_entry {
16731674
// Adds entry which goes from $src_node_id to $dest_node_id over the $candidate hop.
@@ -1832,8 +1833,10 @@ where L::Target: Logger {
18321833
// Ignore hops if they by themselves would already put us over `max_total_routing_fee_msat`
18331834
let max_total_routing_fee_msat = payment_params.max_total_routing_fee_msat.unwrap_or(u64::max_value());
18341835
if total_fee_msat > max_total_routing_fee_msat {
1835-
log_trace!(logger, "Ignoring candidate hop {} as the path's total fee {} would exceed the maximum total routing fee limit {}",
1836-
LoggedCandidateHop(&$candidate), total_fee_msat, max_total_routing_fee_msat);
1836+
if should_log_candidate {
1837+
log_trace!(logger, "Ignoring {} due to exceeding max total routing fee limit.", LoggedCandidateHop(&$candidate));
1838+
}
1839+
num_ignored_total_fee_limit += 1;
18371840
} else {
18381841
let channel_usage = ChannelUsage {
18391842
amount_msat: amount_to_transfer_over_msat,
@@ -2383,9 +2386,9 @@ where L::Target: Logger {
23832386
}
23842387

23852388
let num_ignored_total = num_ignored_value_contribution + num_ignored_path_length_limit +
2386-
num_ignored_cltv_delta_limit + num_ignored_previously_failed;
2389+
num_ignored_cltv_delta_limit + num_ignored_previously_failed + num_ignored_total_fee_limit;
23872390
if num_ignored_total > 0 {
2388-
log_trace!(logger, "Ignored {} candidate hops due to insufficient value contrib., {} due to path length limit, {} due to CLTV delta limit, {} due to them having previously failed. Total: {} ignored candidates.", num_ignored_value_contribution, num_ignored_path_length_limit, num_ignored_cltv_delta_limit, num_ignored_previously_failed, num_ignored_total);
2391+
log_trace!(logger, "Ignored {} candidate hops due to insufficient value contrib., {} due to path length limit, {} due to CLTV delta limit, {} due to them having previously failed, {} due to maximum total fee limit. Total: {} ignored candidates.", num_ignored_value_contribution, num_ignored_path_length_limit, num_ignored_cltv_delta_limit, num_ignored_previously_failed, num_ignored_total_fee_limit, num_ignored_total);
23892392
}
23902393

23912394
// Step (5).

0 commit comments

Comments
 (0)