@@ -863,15 +863,15 @@ impl OutboundPayments {
863863 SP : Fn ( SendAlongPathArgs ) -> Result < ( ) , APIError > ,
864864 {
865865 let payment_hash = invoice. payment_hash ( ) ;
866- let max_total_routing_fee_msat ;
866+ let params_config ;
867867 let retry_strategy;
868868 match self . pending_outbound_payments . lock ( ) . unwrap ( ) . entry ( payment_id) {
869869 hash_map:: Entry :: Occupied ( entry) => match entry. get ( ) {
870870 PendingOutboundPayment :: AwaitingInvoice {
871871 retry_strategy : retry, route_params_config, ..
872872 } => {
873873 retry_strategy = * retry;
874- max_total_routing_fee_msat = route_params_config. max_total_routing_fee_msat ;
874+ params_config = * route_params_config;
875875 * entry. into_mut ( ) = PendingOutboundPayment :: InvoiceReceived {
876876 payment_hash,
877877 retry_strategy : * retry,
@@ -891,9 +891,9 @@ impl OutboundPayments {
891891 }
892892
893893 let mut route_params = RouteParameters :: from_payment_params_and_value (
894- PaymentParameters :: from_bolt12_invoice ( & invoice) , invoice. amount_msats ( )
894+ PaymentParameters :: from_bolt12_invoice ( & invoice) . with_user_config ( params_config ) , invoice. amount_msats ( )
895895 ) ;
896- if let Some ( max_fee_msat) = max_total_routing_fee_msat {
896+ if let Some ( max_fee_msat) = params_config . max_total_routing_fee_msat {
897897 route_params. max_total_routing_fee_msat = Some ( max_fee_msat) ;
898898 }
899899 self . send_payment_for_bolt12_invoice_internal (
@@ -1066,7 +1066,7 @@ impl OutboundPayments {
10661066 } ;
10671067 let keysend_preimage = PaymentPreimage ( entropy_source. get_secure_random_bytes ( ) ) ;
10681068 let payment_hash = PaymentHash ( Sha256 :: hash ( & keysend_preimage. 0 ) . to_byte_array ( ) ) ;
1069- let pay_params = PaymentParameters :: from_static_invoice ( invoice) ;
1069+ let pay_params = PaymentParameters :: from_static_invoice ( invoice) . with_user_config ( * route_params_config ) ;
10701070 let mut route_params = RouteParameters :: from_payment_params_and_value ( pay_params, amount_msat) ;
10711071 route_params. max_total_routing_fee_msat = route_params_config. max_total_routing_fee_msat ;
10721072
0 commit comments