@@ -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. as_ref ( ) ,
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) => {
@@ -1045,7 +1046,7 @@ impl OutboundPayments {
1045
1046
1046
1047
if let Err ( ( ) ) = onion_utils:: set_max_path_length (
1047
1048
& mut route_params, & RecipientOnionFields :: spontaneous_empty ( ) , Some ( keysend_preimage) ,
1048
- best_block_height
1049
+ Some ( invreq ) , best_block_height
1049
1050
) {
1050
1051
abandon_with_entry ! ( entry, PaymentFailureReason :: RouteNotFound ) ;
1051
1052
return Err ( Bolt12PaymentError :: SendingFailed ( RetryableSendFailure :: OnionPacketSizeExceeded ) )
@@ -1175,8 +1176,8 @@ impl OutboundPayments {
1175
1176
}
1176
1177
1177
1178
fn find_initial_route < R : Deref , NS : Deref , IH , L : Deref > (
1178
- & self , payment_id : PaymentId , payment_hash : PaymentHash ,
1179
- recipient_onion : & RecipientOnionFields , keysend_preimage : Option < PaymentPreimage > ,
1179
+ & self , payment_id : PaymentId , payment_hash : PaymentHash , recipient_onion : & RecipientOnionFields ,
1180
+ keysend_preimage : Option < PaymentPreimage > , invoice_request : Option < & InvoiceRequest > ,
1180
1181
route_params : & mut RouteParameters , router : & R , first_hops : & Vec < ChannelDetails > ,
1181
1182
inflight_htlcs : & IH , node_signer : & NS , best_block_height : u32 , logger : & L ,
1182
1183
) -> Result < Route , RetryableSendFailure >
@@ -1195,7 +1196,7 @@ impl OutboundPayments {
1195
1196
}
1196
1197
1197
1198
onion_utils:: set_max_path_length (
1198
- route_params, recipient_onion, keysend_preimage, best_block_height
1199
+ route_params, recipient_onion, keysend_preimage, invoice_request , best_block_height
1199
1200
)
1200
1201
. map_err ( |( ) | {
1201
1202
log_error ! ( logger, "Can't construct an onion packet without exceeding 1300-byte onion \
@@ -1243,7 +1244,7 @@ impl OutboundPayments {
1243
1244
SP : Fn ( SendAlongPathArgs ) -> Result < ( ) , APIError > ,
1244
1245
{
1245
1246
let route = self . find_initial_route (
1246
- payment_id, payment_hash, & recipient_onion, keysend_preimage, & mut route_params, router,
1247
+ payment_id, payment_hash, & recipient_onion, keysend_preimage, None , & mut route_params, router,
1247
1248
& first_hops, & inflight_htlcs, node_signer, best_block_height, logger,
1248
1249
) ?;
1249
1250
0 commit comments