Log max routing fee before we start pathfinding 2023-09-route-overpay-limit
authorMatt Corallo <git@bluematt.me>
Thu, 28 Sep 2023 17:51:05 +0000 (17:51 +0000)
committerMatt Corallo <git@bluematt.me>
Thu, 28 Sep 2023 20:39:36 +0000 (20:39 +0000)
This may be useful in debugging routing failures in the future.

lightning/src/routing/router.rs

index 19cf4e05d950d2b7c7b05cabdfd33a7377c5526a..33182f7cb0d87f94723356345e0a2f3199b5eeb1 100644 (file)
@@ -1622,9 +1622,13 @@ where L::Target: Logger {
                        |info| info.features.supports_basic_mpp()))
        } else { false };
 
-       log_trace!(logger, "Searching for a route from payer {} to {} {} MPP and {} first hops {}overriding the network graph", our_node_pubkey,
-               LoggedPayeePubkey(payment_params.payee.node_id()), if allow_mpp { "with" } else { "without" },
-               first_hops.map(|hops| hops.len()).unwrap_or(0), if first_hops.is_some() { "" } else { "not " });
+       let max_total_routing_fee_msat = route_params.max_total_routing_fee_msat.unwrap_or(u64::max_value());
+
+       log_trace!(logger, "Searching for a route from payer {} to {} {} MPP and {} first hops {}overriding the network graph with a fee limit of {} msat",
+               our_node_pubkey, LoggedPayeePubkey(payment_params.payee.node_id()),
+               if allow_mpp { "with" } else { "without" },
+               first_hops.map(|hops| hops.len()).unwrap_or(0), if first_hops.is_some() { "" } else { "not " },
+               max_total_routing_fee_msat);
 
        // Step (1).
        // Prepare the data we'll use for payee-to-payer search by
@@ -1890,7 +1894,6 @@ where L::Target: Logger {
                                                        }
 
                                                        // Ignore hops if augmenting the current path to them would put us over `max_total_routing_fee_msat`
-                                                       let max_total_routing_fee_msat = route_params.max_total_routing_fee_msat.unwrap_or(u64::max_value());
                                                        if total_fee_msat > max_total_routing_fee_msat {
                                                                if should_log_candidate {
                                                                        log_trace!(logger, "Ignoring {} due to exceeding max total routing fee limit.", LoggedCandidateHop(&$candidate));