Skip to content

Commit b6fec99

Browse files
committed
f Log candidates we ignored due to fee limit
1 parent 1432c36 commit b6fec99

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
@@ -1671,6 +1671,7 @@ where L::Target: Logger {
16711671
let mut num_ignored_path_length_limit = 0;
16721672
let mut num_ignored_cltv_delta_limit = 0;
16731673
let mut num_ignored_previously_failed = 0;
1674+
let mut num_ignored_total_fee_limit = 0;
16741675

16751676
macro_rules! add_entry {
16761677
// Adds entry which goes from $src_node_id to $dest_node_id over the $candidate hop.
@@ -1835,8 +1836,10 @@ where L::Target: Logger {
18351836
// Ignore hops if they by themselves would already put us over `max_total_routing_fee_msat`
18361837
let max_total_routing_fee_msat = payment_params.max_total_routing_fee_msat.unwrap_or(u64::max_value());
18371838
if total_fee_msat > max_total_routing_fee_msat {
1838-
log_trace!(logger, "Ignoring candidate hop {} as the path's total fee {} would exceed the maximum total routing fee limit {}",
1839-
LoggedCandidateHop(&$candidate), total_fee_msat, max_total_routing_fee_msat);
1839+
if should_log_candidate {
1840+
log_trace!(logger, "Ignoring {} due to exceeding max total routing fee limit.", LoggedCandidateHop(&$candidate));
1841+
}
1842+
num_ignored_total_fee_limit += 1;
18401843
} else {
18411844
let channel_usage = ChannelUsage {
18421845
amount_msat: amount_to_transfer_over_msat,
@@ -2386,9 +2389,9 @@ where L::Target: Logger {
23862389
}
23872390

23882391
let num_ignored_total = num_ignored_value_contribution + num_ignored_path_length_limit +
2389-
num_ignored_cltv_delta_limit + num_ignored_previously_failed;
2392+
num_ignored_cltv_delta_limit + num_ignored_previously_failed + num_ignored_total_fee_limit;
23902393
if num_ignored_total > 0 {
2391-
log_trace!(logger, "Ignored {} candidate hops due to insufficient value contrib., {} due to path length limit, {} due to CLTV delta limit, {} due to previous payment failure. Total: {} ignored candidates.", num_ignored_value_contribution, num_ignored_path_length_limit, num_ignored_cltv_delta_limit, num_ignored_previously_failed, num_ignored_total);
2394+
log_trace!(logger, "Ignored {} candidate hops due to insufficient value contrib., {} due to path length limit, {} due to CLTV delta limit, {} due to previous payment failure, {} 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);
23922395
}
23932396

23942397
// Step (5).

0 commit comments

Comments
 (0)