@@ -844,21 +844,19 @@ impl OutboundPayments {
844844 SP : Fn ( SendAlongPathArgs ) -> Result < ( ) , APIError > ,
845845 {
846846 let payment_hash = invoice. payment_hash ( ) ;
847- let max_total_routing_fee_msat ;
847+ let routing_params ;
848848 let retry_strategy;
849849 match self . pending_outbound_payments . lock ( ) . unwrap ( ) . entry ( payment_id) {
850850 hash_map:: Entry :: Occupied ( entry) => match entry. get ( ) {
851851 PendingOutboundPayment :: AwaitingInvoice {
852852 retry_strategy : retry, manual_routing_params, ..
853853 } => {
854854 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 ( ) ) ;
858856 * entry. into_mut ( ) = PendingOutboundPayment :: InvoiceReceived {
859857 payment_hash,
860858 retry_strategy : * retry,
861- max_total_routing_fee_msat,
859+ max_total_routing_fee_msat : routing_params . max_total_routing_fee_msat ,
862860 } ;
863861 } ,
864862 _ => return Err ( Bolt12PaymentError :: DuplicateInvoice ) ,
@@ -873,12 +871,10 @@ impl OutboundPayments {
873871 return Err ( Bolt12PaymentError :: UnknownRequiredFeatures ) ;
874872 }
875873
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
878876 ) ;
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+
882878 self . send_payment_for_bolt12_invoice_internal (
883879 payment_id, payment_hash, None , route_params, retry_strategy, router, first_hops,
884880 inflight_htlcs, entropy_source, node_signer, node_id_lookup, secp_ctx, best_block_height,
0 commit comments