@@ -844,21 +844,19 @@ impl OutboundPayments {
844
844
SP : Fn ( SendAlongPathArgs ) -> Result < ( ) , APIError > ,
845
845
{
846
846
let payment_hash = invoice. payment_hash ( ) ;
847
- let max_total_routing_fee_msat ;
847
+ let routing_params ;
848
848
let retry_strategy;
849
849
match self . pending_outbound_payments . lock ( ) . unwrap ( ) . entry ( payment_id) {
850
850
hash_map:: Entry :: Occupied ( entry) => match entry. get ( ) {
851
851
PendingOutboundPayment :: AwaitingInvoice {
852
852
retry_strategy : retry, manual_routing_params, ..
853
853
} => {
854
854
retry_strategy = * retry;
855
- max_total_routing_fee_msat = manual_routing_params. map (
856
- |params| params. max_total_routing_fee_msat
857
- ) . flatten ( ) ;
855
+ routing_params = manual_routing_params. unwrap_or_else ( || ManualRoutingParameters :: new ( ) ) ;
858
856
* entry. into_mut ( ) = PendingOutboundPayment :: InvoiceReceived {
859
857
payment_hash,
860
858
retry_strategy : * retry,
861
- max_total_routing_fee_msat,
859
+ max_total_routing_fee_msat : routing_params . max_total_routing_fee_msat ,
862
860
} ;
863
861
} ,
864
862
_ => return Err ( Bolt12PaymentError :: DuplicateInvoice ) ,
@@ -873,12 +871,10 @@ impl OutboundPayments {
873
871
return Err ( Bolt12PaymentError :: UnknownRequiredFeatures ) ;
874
872
}
875
873
876
- let mut route_params = RouteParameters :: from_payment_params_and_value (
877
- PaymentParameters :: from_bolt12_invoice ( & invoice) , invoice. amount_msats ( )
874
+ let route_params = RouteParameters :: from_payment_and_manual_params (
875
+ PaymentParameters :: from_bolt12_invoice ( & invoice) , invoice. amount_msats ( ) , routing_params
878
876
) ;
879
- if let Some ( max_fee_msat) = max_total_routing_fee_msat {
880
- route_params. max_total_routing_fee_msat = Some ( max_fee_msat) ;
881
- }
877
+
882
878
self . send_payment_for_bolt12_invoice_internal (
883
879
payment_id, payment_hash, None , route_params, retry_strategy, router, first_hops,
884
880
inflight_htlcs, entropy_source, node_signer, node_id_lookup, secp_ctx, best_block_height,
0 commit comments