Set max fee in route params for probes
What changed, and why it matters
This change sets a maximum routing fee for Lightning payment probes. Previously, probes used a dummy RouteParameters object with no fee limit. Now the fee cap is set to the actual fee of the fixed probe path. This is a minor hardening/cleanup change that makes fee tracking consistent and removes an explanatory comment. It does not appear to fix an active vulnerability.
No immediate action required. Treat as routine cleanup/defensive improvement. Review whether any downstream logic depends on max_total_routing_fee_msat being None for probes, since the change may affect fee estimation or logging.
Security signals we found
Fee budget now enforced/recorded for probe routes
Removal of justification comment for unbounded probe fee
Defensive consistency between probe and normal payment route parameters
Evidence from the diff
In OutboundPayments::send_probe, the code constructs a RouteParameters from a fixed path for compatibility with the router API. Previously max_total_routing_fee_msat was None, meaning no explicit fee budget was recorded for the probe. The patch sets it to Some(path.fee_msat()), matching the path’s actual fee. This aligns probe behavior with regular payments and removes the comment justifying the prior None value. The change is small, localized, and defensive rather than reactive.
Changed components
lightning/src/ln/outbound_payment.rsOutboundPayments::send_probeRouteParameters construction for probesInspect captured patch +1 / −4
diff --git a/lightning/src/ln/outbound_payment.rs b/lightning/src/ln/outbound_payment.rs
index 105ee35..20b594a 100644
--- a/lightning/src/ln/outbound_payment.rs
+++ b/lightning/src/ln/outbound_payment.rs
@@ -1922,9 +1922,6 @@ impl OutboundPayments {
}))
}
- // `route_params` is a required field, but is unused when sending a probe along a fixed
- // path. Construct dummy parameters from the path, leaving the fee budget unset to match
- // the previous behavior of not tracking one for probes.
let route_params = {
let last_hop = path.hops.last().unwrap();
let payment_params =
@@ -1932,7 +1929,7 @@ impl OutboundPayments {
RouteParameters {
payment_params,
final_value_msat: path.final_value_msat(),
- max_total_routing_fee_msat: None,
+ max_total_routing_fee_msat: Some(path.fee_msat()),
}
};
let route = Route { paths: vec![path], route_params };
Why this scored 18/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.