We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
PartialFailure
1 parent 233a8b2 commit c34a4a9Copy full SHA for c34a4a9
lightning/src/ln/outbound_payment.rs
@@ -1075,8 +1075,14 @@ impl OutboundPayments {
1075
payment_id,
1076
failed_paths_retry: if pending_amt_unsent != 0 {
1077
if let Some(payment_params) = &route.payment_params {
1078
+ let mut payment_params = payment_params.clone();
1079
+ // We calculate the leftover fee budget we're allowed to spend by
1080
+ // subtracting the used fee from the total fee budget.
1081
+ payment_params.max_total_routing_fee_msat = payment_params
1082
+ .max_total_routing_fee_msat.map(|m| m.saturating_sub(route.get_total_fees()));
1083
+
1084
Some(RouteParameters {
- payment_params: payment_params.clone(),
1085
+ payment_params,
1086
final_value_msat: pending_amt_unsent,
1087
})
1088
} else { None }
0 commit comments