@@ -687,6 +687,7 @@ pub(super) struct SendAlongPathArgs<'a> {
687
687
pub cur_height : u32 ,
688
688
pub payment_id : PaymentId ,
689
689
pub keysend_preimage : & ' a Option < PaymentPreimage > ,
690
+ pub invoice_request : Option < & ' a InvoiceRequest > ,
690
691
pub session_priv_bytes : [ u8 ; 32 ] ,
691
692
}
692
693
@@ -734,7 +735,7 @@ impl OutboundPayments {
734
735
F : Fn ( SendAlongPathArgs ) -> Result < ( ) , APIError >
735
736
{
736
737
let onion_session_privs = self . add_new_pending_payment ( payment_hash, recipient_onion. clone ( ) , payment_id, None , route, None , None , entropy_source, best_block_height) ?;
737
- self . pay_route_internal ( route, payment_hash, & recipient_onion, None , payment_id, None ,
738
+ self . pay_route_internal ( route, payment_hash, & recipient_onion, None , None , payment_id, None ,
738
739
onion_session_privs, node_signer, best_block_height, & send_payment_along_path)
739
740
. map_err ( |e| { self . remove_outbound_if_all_failed ( payment_id, & e) ; e } )
740
741
}
@@ -779,7 +780,7 @@ impl OutboundPayments {
779
780
let onion_session_privs = self . add_new_pending_payment ( payment_hash, recipient_onion. clone ( ) ,
780
781
payment_id, Some ( preimage) , & route, None , None , entropy_source, best_block_height) ?;
781
782
782
- match self . pay_route_internal ( route, payment_hash, & recipient_onion, Some ( preimage) ,
783
+ match self . pay_route_internal ( route, payment_hash, & recipient_onion, Some ( preimage) , None ,
783
784
payment_id, None , onion_session_privs, node_signer, best_block_height, & send_payment_along_path
784
785
) {
785
786
Ok ( ( ) ) => Ok ( payment_hash) ,
@@ -904,7 +905,7 @@ impl OutboundPayments {
904
905
}
905
906
906
907
let result = self . pay_route_internal (
907
- & route, payment_hash, & recipient_onion, None , payment_id,
908
+ & route, payment_hash, & recipient_onion, None , None , payment_id,
908
909
Some ( route_params. final_value_msat ) , onion_session_privs, node_signer,
909
910
best_block_height, & send_payment_along_path
910
911
) ;
@@ -1180,7 +1181,7 @@ impl OutboundPayments {
1180
1181
} ) ?;
1181
1182
1182
1183
let res = self . pay_route_internal ( & route, payment_hash, & recipient_onion,
1183
- keysend_preimage, payment_id, None , onion_session_privs, node_signer,
1184
+ keysend_preimage, None , payment_id, None , onion_session_privs, node_signer,
1184
1185
best_block_height, & send_payment_along_path) ;
1185
1186
log_info ! ( logger, "Sending payment with id {} and hash {} returned {:?}" ,
1186
1187
payment_id, payment_hash, res) ;
@@ -1344,7 +1345,7 @@ impl OutboundPayments {
1344
1345
}
1345
1346
} ;
1346
1347
let res = self . pay_route_internal ( & route, payment_hash, & recipient_onion, keysend_preimage,
1347
- payment_id, Some ( total_msat) , onion_session_privs, node_signer, best_block_height,
1348
+ None , payment_id, Some ( total_msat) , onion_session_privs, node_signer, best_block_height,
1348
1349
& send_payment_along_path) ;
1349
1350
log_info ! ( logger, "Result retrying payment id {}: {:?}" , & payment_id, res) ;
1350
1351
if let Err ( e) = res {
@@ -1456,7 +1457,8 @@ impl OutboundPayments {
1456
1457
1457
1458
let recipient_onion_fields = RecipientOnionFields :: spontaneous_empty ( ) ;
1458
1459
match self . pay_route_internal ( & route, payment_hash, & recipient_onion_fields,
1459
- None , payment_id, None , onion_session_privs, node_signer, best_block_height, & send_payment_along_path
1460
+ None , None , payment_id, None , onion_session_privs, node_signer, best_block_height,
1461
+ & send_payment_along_path
1460
1462
) {
1461
1463
Ok ( ( ) ) => Ok ( ( payment_hash, payment_id) ) ,
1462
1464
Err ( e) => {
@@ -1565,9 +1567,9 @@ impl OutboundPayments {
1565
1567
1566
1568
fn pay_route_internal < NS : Deref , F > (
1567
1569
& self , route : & Route , payment_hash : PaymentHash , recipient_onion : & RecipientOnionFields ,
1568
- keysend_preimage : Option < PaymentPreimage > , payment_id : PaymentId , recv_value_msat : Option < u64 > ,
1569
- onion_session_privs : Vec < [ u8 ; 32 ] > , node_signer : & NS , best_block_height : u32 ,
1570
- send_payment_along_path : & F
1570
+ keysend_preimage : Option < PaymentPreimage > , invoice_request : Option < & InvoiceRequest > ,
1571
+ payment_id : PaymentId , recv_value_msat : Option < u64 > , onion_session_privs : Vec < [ u8 ; 32 ] > ,
1572
+ node_signer : & NS , best_block_height : u32 , send_payment_along_path : & F
1571
1573
) -> Result < ( ) , PaymentSendFailure >
1572
1574
where
1573
1575
NS :: Target : NodeSigner ,
@@ -1620,7 +1622,7 @@ impl OutboundPayments {
1620
1622
for ( path, session_priv_bytes) in route. paths . iter ( ) . zip ( onion_session_privs. into_iter ( ) ) {
1621
1623
let mut path_res = send_payment_along_path ( SendAlongPathArgs {
1622
1624
path : & path, payment_hash : & payment_hash, recipient_onion, total_value,
1623
- cur_height, payment_id, keysend_preimage : & keysend_preimage,
1625
+ cur_height, payment_id, keysend_preimage : & keysend_preimage, invoice_request ,
1624
1626
session_priv_bytes
1625
1627
} ) ;
1626
1628
match path_res {
@@ -1705,7 +1707,7 @@ impl OutboundPayments {
1705
1707
F : Fn ( SendAlongPathArgs ) -> Result < ( ) , APIError > ,
1706
1708
{
1707
1709
self . pay_route_internal ( route, payment_hash, & recipient_onion,
1708
- keysend_preimage, payment_id, recv_value_msat, onion_session_privs,
1710
+ keysend_preimage, None , payment_id, recv_value_msat, onion_session_privs,
1709
1711
node_signer, best_block_height, & send_payment_along_path)
1710
1712
. map_err ( |e| { self . remove_outbound_if_all_failed ( payment_id, & e) ; e } )
1711
1713
}
0 commit comments