@@ -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,10 @@ 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)
895+ . with_user_config_ignoring_fee_limit ( params_config) , invoice. amount_msats ( )
895896 ) ;
896- if let Some ( max_fee_msat) = max_total_routing_fee_msat {
897+ if let Some ( max_fee_msat) = params_config . max_total_routing_fee_msat {
897898 route_params. max_total_routing_fee_msat = Some ( max_fee_msat) ;
898899 }
899900 self . send_payment_for_bolt12_invoice_internal (
@@ -1066,7 +1067,8 @@ impl OutboundPayments {
10661067 } ;
10671068 let keysend_preimage = PaymentPreimage ( entropy_source. get_secure_random_bytes ( ) ) ;
10681069 let payment_hash = PaymentHash ( Sha256 :: hash ( & keysend_preimage. 0 ) . to_byte_array ( ) ) ;
1069- let pay_params = PaymentParameters :: from_static_invoice ( invoice) ;
1070+ let pay_params = PaymentParameters :: from_static_invoice ( invoice)
1071+ . with_user_config_ignoring_fee_limit ( * route_params_config) ;
10701072 let mut route_params = RouteParameters :: from_payment_params_and_value ( pay_params, amount_msat) ;
10711073 route_params. max_total_routing_fee_msat = route_params_config. max_total_routing_fee_msat ;
10721074
0 commit comments