@@ -931,8 +931,9 @@ impl OutboundPayments {
931
931
custom_tlvs : vec ! [ ] ,
932
932
} ;
933
933
let route = match self . find_initial_route (
934
- payment_id, payment_hash, & recipient_onion, None , & mut route_params, router,
935
- & first_hops, & inflight_htlcs, node_signer, best_block_height, logger,
934
+ payment_id, payment_hash, & recipient_onion, keysend_preimage, invoice_request. as_ref ( ) ,
935
+ & mut route_params, router, & first_hops, & inflight_htlcs, node_signer, best_block_height,
936
+ logger,
936
937
) {
937
938
Ok ( route) => route,
938
939
Err ( e) => {
@@ -1044,7 +1045,7 @@ impl OutboundPayments {
1044
1045
1045
1046
if let Err ( ( ) ) = onion_utils:: set_max_path_length (
1046
1047
& mut route_params, & RecipientOnionFields :: spontaneous_empty ( ) , Some ( keysend_preimage) ,
1047
- best_block_height
1048
+ Some ( invreq ) , best_block_height
1048
1049
) {
1049
1050
abandon_with_entry ! ( entry, PaymentFailureReason :: RouteNotFound ) ;
1050
1051
return Err ( Bolt12PaymentError :: SendingFailed ( RetryableSendFailure :: OnionPacketSizeExceeded ) )
@@ -1174,8 +1175,8 @@ impl OutboundPayments {
1174
1175
}
1175
1176
1176
1177
fn find_initial_route < R : Deref , NS : Deref , IH , L : Deref > (
1177
- & self , payment_id : PaymentId , payment_hash : PaymentHash ,
1178
- recipient_onion : & RecipientOnionFields , keysend_preimage : Option < PaymentPreimage > ,
1178
+ & self , payment_id : PaymentId , payment_hash : PaymentHash , recipient_onion : & RecipientOnionFields ,
1179
+ keysend_preimage : Option < PaymentPreimage > , invoice_request : Option < & InvoiceRequest > ,
1179
1180
route_params : & mut RouteParameters , router : & R , first_hops : & Vec < ChannelDetails > ,
1180
1181
inflight_htlcs : & IH , node_signer : & NS , best_block_height : u32 , logger : & L ,
1181
1182
) -> Result < Route , RetryableSendFailure >
@@ -1194,7 +1195,7 @@ impl OutboundPayments {
1194
1195
}
1195
1196
1196
1197
onion_utils:: set_max_path_length (
1197
- route_params, recipient_onion, keysend_preimage, best_block_height
1198
+ route_params, recipient_onion, keysend_preimage, invoice_request , best_block_height
1198
1199
) . map_err ( |( ) | RetryableSendFailure :: OnionPacketSizeExceeded ) ?;
1199
1200
1200
1201
let mut route = router. find_route_with_id (
@@ -1237,7 +1238,7 @@ impl OutboundPayments {
1237
1238
SP : Fn ( SendAlongPathArgs ) -> Result < ( ) , APIError > ,
1238
1239
{
1239
1240
let route = self . find_initial_route (
1240
- payment_id, payment_hash, & recipient_onion, keysend_preimage, & mut route_params, router,
1241
+ payment_id, payment_hash, & recipient_onion, keysend_preimage, None , & mut route_params, router,
1241
1242
& first_hops, & inflight_htlcs, node_signer, best_block_height, logger,
1242
1243
) ?;
1243
1244
0 commit comments