@@ -932,8 +932,9 @@ impl OutboundPayments {
932
932
custom_tlvs : vec ! [ ] ,
933
933
} ;
934
934
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,
937
938
) {
938
939
Ok ( route) => route,
939
940
Err ( e) => {
@@ -1052,7 +1053,7 @@ impl OutboundPayments {
1052
1053
1053
1054
if let Err ( ( ) ) = onion_utils:: set_max_path_length (
1054
1055
& mut route_params, & RecipientOnionFields :: spontaneous_empty ( ) , Some ( keysend_preimage) ,
1055
- best_block_height
1056
+ Some ( invreq ) , best_block_height
1056
1057
) {
1057
1058
abandon_with_entry ! ( entry, PaymentFailureReason :: RouteNotFound ) ;
1058
1059
return Err ( Bolt12PaymentError :: SendingFailed ( RetryableSendFailure :: OnionPacketSizeExceeded ) )
@@ -1182,8 +1183,8 @@ impl OutboundPayments {
1182
1183
}
1183
1184
1184
1185
fn find_initial_route < R : Deref , NS : Deref , IH , L : Deref > (
1185
- & self , payment_id : PaymentId , payment_hash : PaymentHash ,
1186
- recipient_onion : & RecipientOnionFields , keysend_preimage : Option < PaymentPreimage > ,
1186
+ & self , payment_id : PaymentId , payment_hash : PaymentHash , recipient_onion : & RecipientOnionFields ,
1187
+ keysend_preimage : Option < PaymentPreimage > , invoice_request : Option < & InvoiceRequest > ,
1187
1188
route_params : & mut RouteParameters , router : & R , first_hops : & Vec < ChannelDetails > ,
1188
1189
inflight_htlcs : & IH , node_signer : & NS , best_block_height : u32 , logger : & L ,
1189
1190
) -> Result < Route , RetryableSendFailure >
@@ -1202,7 +1203,7 @@ impl OutboundPayments {
1202
1203
}
1203
1204
1204
1205
onion_utils:: set_max_path_length (
1205
- route_params, recipient_onion, keysend_preimage, best_block_height
1206
+ route_params, recipient_onion, keysend_preimage, invoice_request , best_block_height
1206
1207
)
1207
1208
. map_err ( |( ) | {
1208
1209
log_error ! ( logger, "Can't construct an onion packet without exceeding 1300-byte onion \
@@ -1250,7 +1251,7 @@ impl OutboundPayments {
1250
1251
SP : Fn ( SendAlongPathArgs ) -> Result < ( ) , APIError > ,
1251
1252
{
1252
1253
let route = self . find_initial_route (
1253
- payment_id, payment_hash, & recipient_onion, keysend_preimage, & mut route_params, router,
1254
+ payment_id, payment_hash, & recipient_onion, keysend_preimage, None , & mut route_params, router,
1254
1255
& first_hops, & inflight_htlcs, node_signer, best_block_height, logger,
1255
1256
) ?;
1256
1257
0 commit comments