@@ -715,6 +715,7 @@ pub(super) struct SendAlongPathArgs<'a> {
715
715
pub cur_height : u32 ,
716
716
pub payment_id : PaymentId ,
717
717
pub keysend_preimage : & ' a Option < PaymentPreimage > ,
718
+ pub invoice_request : Option < & ' a InvoiceRequest > ,
718
719
pub session_priv_bytes : [ u8 ; 32 ] ,
719
720
}
720
721
@@ -768,7 +769,7 @@ impl OutboundPayments {
768
769
F : Fn ( SendAlongPathArgs ) -> Result < ( ) , APIError >
769
770
{
770
771
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) ?;
771
- self . pay_route_internal ( route, payment_hash, & recipient_onion, None , payment_id, None ,
772
+ self . pay_route_internal ( route, payment_hash, & recipient_onion, None , None , payment_id, None ,
772
773
onion_session_privs, node_signer, best_block_height, & send_payment_along_path)
773
774
. map_err ( |e| { self . remove_outbound_if_all_failed ( payment_id, & e) ; e } )
774
775
}
@@ -813,7 +814,7 @@ impl OutboundPayments {
813
814
let onion_session_privs = self . add_new_pending_payment ( payment_hash, recipient_onion. clone ( ) ,
814
815
payment_id, Some ( preimage) , & route, None , None , entropy_source, best_block_height) ?;
815
816
816
- match self . pay_route_internal ( route, payment_hash, & recipient_onion, Some ( preimage) ,
817
+ match self . pay_route_internal ( route, payment_hash, & recipient_onion, Some ( preimage) , None ,
817
818
payment_id, None , onion_session_privs, node_signer, best_block_height, & send_payment_along_path
818
819
) {
819
820
Ok ( ( ) ) => Ok ( payment_hash) ,
@@ -961,7 +962,7 @@ impl OutboundPayments {
961
962
}
962
963
963
964
let result = self . pay_route_internal (
964
- & route, payment_hash, & recipient_onion, keysend_preimage, payment_id,
965
+ & route, payment_hash, & recipient_onion, keysend_preimage, None , payment_id,
965
966
Some ( route_params. final_value_msat ) , onion_session_privs, node_signer,
966
967
best_block_height, & send_payment_along_path
967
968
) ;
@@ -1236,7 +1237,7 @@ impl OutboundPayments {
1236
1237
} ) ?;
1237
1238
1238
1239
let res = self . pay_route_internal ( & route, payment_hash, & recipient_onion,
1239
- keysend_preimage, payment_id, None , onion_session_privs, node_signer,
1240
+ keysend_preimage, None , payment_id, None , onion_session_privs, node_signer,
1240
1241
best_block_height, & send_payment_along_path) ;
1241
1242
log_info ! ( logger, "Sending payment with id {} and hash {} returned {:?}" ,
1242
1243
payment_id, payment_hash, res) ;
@@ -1390,7 +1391,7 @@ impl OutboundPayments {
1390
1391
}
1391
1392
} ;
1392
1393
let res = self . pay_route_internal ( & route, payment_hash, & recipient_onion, keysend_preimage,
1393
- payment_id, Some ( total_msat) , onion_session_privs, node_signer, best_block_height,
1394
+ None , payment_id, Some ( total_msat) , onion_session_privs, node_signer, best_block_height,
1394
1395
& send_payment_along_path) ;
1395
1396
log_info ! ( logger, "Result retrying payment id {}: {:?}" , & payment_id, res) ;
1396
1397
if let Err ( e) = res {
@@ -1502,7 +1503,8 @@ impl OutboundPayments {
1502
1503
1503
1504
let recipient_onion_fields = RecipientOnionFields :: spontaneous_empty ( ) ;
1504
1505
match self . pay_route_internal ( & route, payment_hash, & recipient_onion_fields,
1505
- None , payment_id, None , onion_session_privs, node_signer, best_block_height, & send_payment_along_path
1506
+ None , None , payment_id, None , onion_session_privs, node_signer, best_block_height,
1507
+ & send_payment_along_path
1506
1508
) {
1507
1509
Ok ( ( ) ) => Ok ( ( payment_hash, payment_id) ) ,
1508
1510
Err ( e) => {
@@ -1614,9 +1616,9 @@ impl OutboundPayments {
1614
1616
1615
1617
fn pay_route_internal < NS : Deref , F > (
1616
1618
& self , route : & Route , payment_hash : PaymentHash , recipient_onion : & RecipientOnionFields ,
1617
- keysend_preimage : Option < PaymentPreimage > , payment_id : PaymentId , recv_value_msat : Option < u64 > ,
1618
- onion_session_privs : Vec < [ u8 ; 32 ] > , node_signer : & NS , best_block_height : u32 ,
1619
- send_payment_along_path : & F
1619
+ keysend_preimage : Option < PaymentPreimage > , invoice_request : Option < & InvoiceRequest > ,
1620
+ payment_id : PaymentId , recv_value_msat : Option < u64 > , onion_session_privs : Vec < [ u8 ; 32 ] > ,
1621
+ node_signer : & NS , best_block_height : u32 , send_payment_along_path : & F
1620
1622
) -> Result < ( ) , PaymentSendFailure >
1621
1623
where
1622
1624
NS :: Target : NodeSigner ,
@@ -1669,7 +1671,7 @@ impl OutboundPayments {
1669
1671
for ( path, session_priv_bytes) in route. paths . iter ( ) . zip ( onion_session_privs. into_iter ( ) ) {
1670
1672
let mut path_res = send_payment_along_path ( SendAlongPathArgs {
1671
1673
path : & path, payment_hash : & payment_hash, recipient_onion, total_value,
1672
- cur_height, payment_id, keysend_preimage : & keysend_preimage,
1674
+ cur_height, payment_id, keysend_preimage : & keysend_preimage, invoice_request ,
1673
1675
session_priv_bytes
1674
1676
} ) ;
1675
1677
match path_res {
@@ -1754,7 +1756,7 @@ impl OutboundPayments {
1754
1756
F : Fn ( SendAlongPathArgs ) -> Result < ( ) , APIError > ,
1755
1757
{
1756
1758
self . pay_route_internal ( route, payment_hash, & recipient_onion,
1757
- keysend_preimage, payment_id, recv_value_msat, onion_session_privs,
1759
+ keysend_preimage, None , payment_id, recv_value_msat, onion_session_privs,
1758
1760
node_signer, best_block_height, & send_payment_along_path)
1759
1761
. map_err ( |e| { self . remove_outbound_if_all_failed ( payment_id, & e) ; e } )
1760
1762
}
0 commit comments