@@ -716,6 +716,7 @@ pub(super) struct SendAlongPathArgs<'a> {
716
716
pub cur_height : u32 ,
717
717
pub payment_id : PaymentId ,
718
718
pub keysend_preimage : & ' a Option < PaymentPreimage > ,
719
+ pub invoice_request : Option < & ' a InvoiceRequest > ,
719
720
pub session_priv_bytes : [ u8 ; 32 ] ,
720
721
}
721
722
@@ -769,7 +770,7 @@ impl OutboundPayments {
769
770
F : Fn ( SendAlongPathArgs ) -> Result < ( ) , APIError >
770
771
{
771
772
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) ?;
772
- self . pay_route_internal ( route, payment_hash, & recipient_onion, None , payment_id, None ,
773
+ self . pay_route_internal ( route, payment_hash, & recipient_onion, None , None , payment_id, None ,
773
774
onion_session_privs, node_signer, best_block_height, & send_payment_along_path)
774
775
. map_err ( |e| { self . remove_outbound_if_all_failed ( payment_id, & e) ; e } )
775
776
}
@@ -814,7 +815,7 @@ impl OutboundPayments {
814
815
let onion_session_privs = self . add_new_pending_payment ( payment_hash, recipient_onion. clone ( ) ,
815
816
payment_id, Some ( preimage) , & route, None , None , entropy_source, best_block_height) ?;
816
817
817
- match self . pay_route_internal ( route, payment_hash, & recipient_onion, Some ( preimage) ,
818
+ match self . pay_route_internal ( route, payment_hash, & recipient_onion, Some ( preimage) , None ,
818
819
payment_id, None , onion_session_privs, node_signer, best_block_height, & send_payment_along_path
819
820
) {
820
821
Ok ( ( ) ) => Ok ( payment_hash) ,
@@ -962,7 +963,7 @@ impl OutboundPayments {
962
963
}
963
964
964
965
let result = self . pay_route_internal (
965
- & route, payment_hash, & recipient_onion, keysend_preimage, payment_id,
966
+ & route, payment_hash, & recipient_onion, keysend_preimage, None , payment_id,
966
967
Some ( route_params. final_value_msat ) , onion_session_privs, node_signer,
967
968
best_block_height, & send_payment_along_path
968
969
) ;
@@ -1242,7 +1243,7 @@ impl OutboundPayments {
1242
1243
} ) ?;
1243
1244
1244
1245
let res = self . pay_route_internal ( & route, payment_hash, & recipient_onion,
1245
- keysend_preimage, payment_id, None , onion_session_privs, node_signer,
1246
+ keysend_preimage, None , payment_id, None , onion_session_privs, node_signer,
1246
1247
best_block_height, & send_payment_along_path) ;
1247
1248
log_info ! ( logger, "Sending payment with id {} and hash {} returned {:?}" ,
1248
1249
payment_id, payment_hash, res) ;
@@ -1396,7 +1397,7 @@ impl OutboundPayments {
1396
1397
}
1397
1398
} ;
1398
1399
let res = self . pay_route_internal ( & route, payment_hash, & recipient_onion, keysend_preimage,
1399
- payment_id, Some ( total_msat) , onion_session_privs, node_signer, best_block_height,
1400
+ None , payment_id, Some ( total_msat) , onion_session_privs, node_signer, best_block_height,
1400
1401
& send_payment_along_path) ;
1401
1402
log_info ! ( logger, "Result retrying payment id {}: {:?}" , & payment_id, res) ;
1402
1403
if let Err ( e) = res {
@@ -1508,7 +1509,8 @@ impl OutboundPayments {
1508
1509
1509
1510
let recipient_onion_fields = RecipientOnionFields :: spontaneous_empty ( ) ;
1510
1511
match self . pay_route_internal ( & route, payment_hash, & recipient_onion_fields,
1511
- None , payment_id, None , onion_session_privs, node_signer, best_block_height, & send_payment_along_path
1512
+ None , None , payment_id, None , onion_session_privs, node_signer, best_block_height,
1513
+ & send_payment_along_path
1512
1514
) {
1513
1515
Ok ( ( ) ) => Ok ( ( payment_hash, payment_id) ) ,
1514
1516
Err ( e) => {
@@ -1620,9 +1622,9 @@ impl OutboundPayments {
1620
1622
1621
1623
fn pay_route_internal < NS : Deref , F > (
1622
1624
& self , route : & Route , payment_hash : PaymentHash , recipient_onion : & RecipientOnionFields ,
1623
- keysend_preimage : Option < PaymentPreimage > , payment_id : PaymentId , recv_value_msat : Option < u64 > ,
1624
- onion_session_privs : Vec < [ u8 ; 32 ] > , node_signer : & NS , best_block_height : u32 ,
1625
- send_payment_along_path : & F
1625
+ keysend_preimage : Option < PaymentPreimage > , invoice_request : Option < & InvoiceRequest > ,
1626
+ payment_id : PaymentId , recv_value_msat : Option < u64 > , onion_session_privs : Vec < [ u8 ; 32 ] > ,
1627
+ node_signer : & NS , best_block_height : u32 , send_payment_along_path : & F
1626
1628
) -> Result < ( ) , PaymentSendFailure >
1627
1629
where
1628
1630
NS :: Target : NodeSigner ,
@@ -1675,7 +1677,7 @@ impl OutboundPayments {
1675
1677
for ( path, session_priv_bytes) in route. paths . iter ( ) . zip ( onion_session_privs. into_iter ( ) ) {
1676
1678
let mut path_res = send_payment_along_path ( SendAlongPathArgs {
1677
1679
path : & path, payment_hash : & payment_hash, recipient_onion, total_value,
1678
- cur_height, payment_id, keysend_preimage : & keysend_preimage,
1680
+ cur_height, payment_id, keysend_preimage : & keysend_preimage, invoice_request ,
1679
1681
session_priv_bytes
1680
1682
} ) ;
1681
1683
match path_res {
@@ -1760,7 +1762,7 @@ impl OutboundPayments {
1760
1762
F : Fn ( SendAlongPathArgs ) -> Result < ( ) , APIError > ,
1761
1763
{
1762
1764
self . pay_route_internal ( route, payment_hash, & recipient_onion,
1763
- keysend_preimage, payment_id, recv_value_msat, onion_session_privs,
1765
+ keysend_preimage, None , payment_id, recv_value_msat, onion_session_privs,
1764
1766
node_signer, best_block_height, & send_payment_along_path)
1765
1767
. map_err ( |e| { self . remove_outbound_if_all_failed ( payment_id, & e) ; e } )
1766
1768
}
0 commit comments