@@ -702,6 +702,7 @@ pub(super) struct SendAlongPathArgs<'a> {
702
702
pub cur_height : u32 ,
703
703
pub payment_id : PaymentId ,
704
704
pub keysend_preimage : & ' a Option < PaymentPreimage > ,
705
+ pub invoice_request : Option < & ' a InvoiceRequest > ,
705
706
pub session_priv_bytes : [ u8 ; 32 ] ,
706
707
}
707
708
@@ -749,7 +750,7 @@ impl OutboundPayments {
749
750
F : Fn ( SendAlongPathArgs ) -> Result < ( ) , APIError >
750
751
{
751
752
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) ?;
752
- self . pay_route_internal ( route, payment_hash, & recipient_onion, None , payment_id, None ,
753
+ self . pay_route_internal ( route, payment_hash, & recipient_onion, None , None , payment_id, None ,
753
754
onion_session_privs, node_signer, best_block_height, & send_payment_along_path)
754
755
. map_err ( |e| { self . remove_outbound_if_all_failed ( payment_id, & e) ; e } )
755
756
}
@@ -794,7 +795,7 @@ impl OutboundPayments {
794
795
let onion_session_privs = self . add_new_pending_payment ( payment_hash, recipient_onion. clone ( ) ,
795
796
payment_id, Some ( preimage) , & route, None , None , entropy_source, best_block_height) ?;
796
797
797
- match self . pay_route_internal ( route, payment_hash, & recipient_onion, Some ( preimage) ,
798
+ match self . pay_route_internal ( route, payment_hash, & recipient_onion, Some ( preimage) , None ,
798
799
payment_id, None , onion_session_privs, node_signer, best_block_height, & send_payment_along_path
799
800
) {
800
801
Ok ( ( ) ) => Ok ( payment_hash) ,
@@ -912,7 +913,7 @@ impl OutboundPayments {
912
913
}
913
914
914
915
let result = self . pay_route_internal (
915
- & route, payment_hash, & recipient_onion, None , payment_id,
916
+ & route, payment_hash, & recipient_onion, None , None , payment_id,
916
917
Some ( route_params. final_value_msat ) , onion_session_privs, node_signer,
917
918
best_block_height, & send_payment_along_path
918
919
) ;
@@ -1154,7 +1155,7 @@ impl OutboundPayments {
1154
1155
} ) ?;
1155
1156
1156
1157
let res = self . pay_route_internal ( & route, payment_hash, & recipient_onion,
1157
- keysend_preimage, payment_id, None , onion_session_privs, node_signer,
1158
+ keysend_preimage, None , payment_id, None , onion_session_privs, node_signer,
1158
1159
best_block_height, & send_payment_along_path) ;
1159
1160
log_info ! ( logger, "Sending payment with id {} and hash {} returned {:?}" ,
1160
1161
payment_id, payment_hash, res) ;
@@ -1318,7 +1319,7 @@ impl OutboundPayments {
1318
1319
}
1319
1320
} ;
1320
1321
let res = self . pay_route_internal ( & route, payment_hash, & recipient_onion, keysend_preimage,
1321
- payment_id, Some ( total_msat) , onion_session_privs, node_signer, best_block_height,
1322
+ None , payment_id, Some ( total_msat) , onion_session_privs, node_signer, best_block_height,
1322
1323
& send_payment_along_path) ;
1323
1324
log_info ! ( logger, "Result retrying payment id {}: {:?}" , & payment_id, res) ;
1324
1325
if let Err ( e) = res {
@@ -1430,7 +1431,8 @@ impl OutboundPayments {
1430
1431
1431
1432
let recipient_onion_fields = RecipientOnionFields :: spontaneous_empty ( ) ;
1432
1433
match self . pay_route_internal ( & route, payment_hash, & recipient_onion_fields,
1433
- None , payment_id, None , onion_session_privs, node_signer, best_block_height, & send_payment_along_path
1434
+ None , None , payment_id, None , onion_session_privs, node_signer, best_block_height,
1435
+ & send_payment_along_path
1434
1436
) {
1435
1437
Ok ( ( ) ) => Ok ( ( payment_hash, payment_id) ) ,
1436
1438
Err ( e) => {
@@ -1539,9 +1541,9 @@ impl OutboundPayments {
1539
1541
1540
1542
fn pay_route_internal < NS : Deref , F > (
1541
1543
& self , route : & Route , payment_hash : PaymentHash , recipient_onion : & RecipientOnionFields ,
1542
- keysend_preimage : Option < PaymentPreimage > , payment_id : PaymentId , recv_value_msat : Option < u64 > ,
1543
- onion_session_privs : Vec < [ u8 ; 32 ] > , node_signer : & NS , best_block_height : u32 ,
1544
- send_payment_along_path : & F
1544
+ keysend_preimage : Option < PaymentPreimage > , invoice_request : Option < & InvoiceRequest > ,
1545
+ payment_id : PaymentId , recv_value_msat : Option < u64 > , onion_session_privs : Vec < [ u8 ; 32 ] > ,
1546
+ node_signer : & NS , best_block_height : u32 , send_payment_along_path : & F
1545
1547
) -> Result < ( ) , PaymentSendFailure >
1546
1548
where
1547
1549
NS :: Target : NodeSigner ,
@@ -1594,7 +1596,7 @@ impl OutboundPayments {
1594
1596
for ( path, session_priv_bytes) in route. paths . iter ( ) . zip ( onion_session_privs. into_iter ( ) ) {
1595
1597
let mut path_res = send_payment_along_path ( SendAlongPathArgs {
1596
1598
path : & path, payment_hash : & payment_hash, recipient_onion, total_value,
1597
- cur_height, payment_id, keysend_preimage : & keysend_preimage,
1599
+ cur_height, payment_id, keysend_preimage : & keysend_preimage, invoice_request ,
1598
1600
session_priv_bytes
1599
1601
} ) ;
1600
1602
match path_res {
@@ -1679,7 +1681,7 @@ impl OutboundPayments {
1679
1681
F : Fn ( SendAlongPathArgs ) -> Result < ( ) , APIError > ,
1680
1682
{
1681
1683
self . pay_route_internal ( route, payment_hash, & recipient_onion,
1682
- keysend_preimage, payment_id, recv_value_msat, onion_session_privs,
1684
+ keysend_preimage, None , payment_id, recv_value_msat, onion_session_privs,
1683
1685
node_signer, best_block_height, & send_payment_along_path)
1684
1686
. map_err ( |e| { self . remove_outbound_if_all_failed ( payment_id, & e) ; e } )
1685
1687
}
0 commit comments