@@ -932,8 +932,9 @@ impl OutboundPayments {
932932 custom_tlvs : vec ! [ ] ,
933933 } ;
934934 let route = match self . find_initial_route (
935- payment_id, payment_hash, & recipient_onion, None , & mut route_params, router,
936- & first_hops, & inflight_htlcs, node_signer, best_block_height, logger,
935+ payment_id, payment_hash, & recipient_onion, keysend_preimage, invoice_request,
936+ & mut route_params, router, & first_hops, & inflight_htlcs, node_signer, best_block_height,
937+ logger,
937938 ) {
938939 Ok ( route) => route,
939940 Err ( e) => {
@@ -1055,7 +1056,7 @@ impl OutboundPayments {
10551056
10561057 if let Err ( ( ) ) = onion_utils:: set_max_path_length (
10571058 & mut route_params, & RecipientOnionFields :: spontaneous_empty ( ) , Some ( keysend_preimage) ,
1058- best_block_height
1059+ Some ( invreq ) , best_block_height
10591060 ) {
10601061 abandon_with_entry ! ( entry, PaymentFailureReason :: RouteNotFound ) ;
10611062 return Err ( Bolt12PaymentError :: SendingFailed ( RetryableSendFailure :: OnionPacketSizeExceeded ) )
@@ -1185,8 +1186,8 @@ impl OutboundPayments {
11851186 }
11861187
11871188 fn find_initial_route < R : Deref , NS : Deref , IH , L : Deref > (
1188- & self , payment_id : PaymentId , payment_hash : PaymentHash ,
1189- recipient_onion : & RecipientOnionFields , keysend_preimage : Option < PaymentPreimage > ,
1189+ & self , payment_id : PaymentId , payment_hash : PaymentHash , recipient_onion : & RecipientOnionFields ,
1190+ keysend_preimage : Option < PaymentPreimage > , invoice_request : Option < & InvoiceRequest > ,
11901191 route_params : & mut RouteParameters , router : & R , first_hops : & Vec < ChannelDetails > ,
11911192 inflight_htlcs : & IH , node_signer : & NS , best_block_height : u32 , logger : & L ,
11921193 ) -> Result < Route , RetryableSendFailure >
@@ -1205,7 +1206,7 @@ impl OutboundPayments {
12051206 }
12061207
12071208 onion_utils:: set_max_path_length (
1208- route_params, recipient_onion, keysend_preimage, best_block_height
1209+ route_params, recipient_onion, keysend_preimage, invoice_request , best_block_height
12091210 )
12101211 . map_err ( |( ) | {
12111212 log_error ! ( logger, "Can't construct an onion packet without exceeding 1300-byte onion \
@@ -1253,7 +1254,7 @@ impl OutboundPayments {
12531254 SP : Fn ( SendAlongPathArgs ) -> Result < ( ) , APIError > ,
12541255 {
12551256 let route = self . find_initial_route (
1256- payment_id, payment_hash, & recipient_onion, keysend_preimage, & mut route_params, router,
1257+ payment_id, payment_hash, & recipient_onion, keysend_preimage, None , & mut route_params, router,
12571258 & first_hops, & inflight_htlcs, node_signer, best_block_height, logger,
12581259 ) ?;
12591260
0 commit comments