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