@@ -992,26 +992,29 @@ impl OutboundPayments {
992992 IH : Fn ( ) -> InFlightHtlcs ,
993993 SP : Fn ( SendAlongPathArgs ) -> Result < ( ) , APIError > ,
994994 {
995- let ( payment_hash, keysend_preimage , mut route_params) =
995+ let ( payment_hash, route_params) =
996996 match self . pending_outbound_payments . lock ( ) . unwrap ( ) . entry ( payment_id) {
997- hash_map:: Entry :: Occupied ( entry) => match entry. get ( ) {
997+ hash_map:: Entry :: Occupied ( mut entry) => match entry. get_mut ( ) {
998998 PendingOutboundPayment :: StaticInvoiceReceived {
999- payment_hash, payment_release_secret : release_secret, keysend_preimage, route_params, ..
999+ payment_hash, payment_release_secret : release_secret, keysend_preimage, invoice_request,
1000+ route_params, ..
10001001 } => {
10011002 if payment_release_secret != * release_secret {
10021003 return Err ( Bolt12PaymentError :: UnexpectedInvoice )
10031004 }
1004- ( * payment_hash, * keysend_preimage, route_params. clone ( ) )
1005+
1006+ onion_utils:: set_max_path_length (
1007+ route_params, & RecipientOnionFields :: spontaneous_empty ( ) ,
1008+ Some ( * keysend_preimage) , Some ( invoice_request) , best_block_height
1009+ ) . map_err ( |( ) | Bolt12PaymentError :: SendingFailed ( RetryableSendFailure :: OnionPacketSizeExceeded ) ) ?;
1010+
1011+ ( * payment_hash, route_params. clone ( ) )
10051012 } ,
10061013 _ => return Err ( Bolt12PaymentError :: DuplicateInvoice ) ,
10071014 } ,
10081015 hash_map:: Entry :: Vacant ( _) => return Err ( Bolt12PaymentError :: UnexpectedInvoice ) ,
10091016 } ;
10101017
1011- onion_utils:: set_max_path_length (
1012- & mut route_params, & RecipientOnionFields :: spontaneous_empty ( ) , Some ( keysend_preimage) , best_block_height
1013- ) . map_err ( |( ) | Bolt12PaymentError :: SendingFailed ( RetryableSendFailure :: OnionPacketSizeExceeded ) ) ?;
1014-
10151018 self . find_route_and_send_payment (
10161019 payment_hash, payment_id, route_params, router, first_hops, & inflight_htlcs,
10171020 entropy_source, node_signer, best_block_height, logger, pending_events,
@@ -1106,7 +1109,7 @@ impl OutboundPayments {
11061109 }
11071110
11081111 onion_utils:: set_max_path_length (
1109- route_params, recipient_onion, keysend_preimage, best_block_height
1112+ route_params, recipient_onion, keysend_preimage, None , best_block_height
11101113 ) . map_err ( |( ) | RetryableSendFailure :: OnionPacketSizeExceeded ) ?;
11111114
11121115 let mut route = router. find_route_with_id (
0 commit comments