@@ -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) => {
@@ -1055,7 +1056,7 @@ impl OutboundPayments {
1055
1056
1056
1057
if let Err ( ( ) ) = onion_utils:: set_max_path_length (
1057
1058
& mut route_params, & RecipientOnionFields :: spontaneous_empty ( ) , Some ( keysend_preimage) ,
1058
- best_block_height
1059
+ Some ( invreq ) , best_block_height
1059
1060
) {
1060
1061
abandon_with_entry ! ( entry, PaymentFailureReason :: RouteNotFound ) ;
1061
1062
return Err ( Bolt12PaymentError :: SendingFailed ( RetryableSendFailure :: OnionPacketSizeExceeded ) )
@@ -1185,8 +1186,8 @@ impl OutboundPayments {
1185
1186
}
1186
1187
1187
1188
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 > ,
1190
1191
route_params : & mut RouteParameters , router : & R , first_hops : & Vec < ChannelDetails > ,
1191
1192
inflight_htlcs : & IH , node_signer : & NS , best_block_height : u32 , logger : & L ,
1192
1193
) -> Result < Route , RetryableSendFailure >
@@ -1205,7 +1206,7 @@ impl OutboundPayments {
1205
1206
}
1206
1207
1207
1208
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
1209
1210
)
1210
1211
. map_err ( |( ) | {
1211
1212
log_error ! ( logger, "Can't construct an onion packet without exceeding 1300-byte onion \
@@ -1253,7 +1254,7 @@ impl OutboundPayments {
1253
1254
SP : Fn ( SendAlongPathArgs ) -> Result < ( ) , APIError > ,
1254
1255
{
1255
1256
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,
1257
1258
& first_hops, & inflight_htlcs, node_signer, best_block_height, logger,
1258
1259
) ?;
1259
1260
0 commit comments