@@ -702,6 +702,7 @@ pub(super) struct SendAlongPathArgs<'a> {
702702 pub cur_height : u32 ,
703703 pub payment_id : PaymentId ,
704704 pub keysend_preimage : & ' a Option < PaymentPreimage > ,
705+ pub invoice_request : Option < & ' a InvoiceRequest > ,
705706 pub session_priv_bytes : [ u8 ; 32 ] ,
706707}
707708
@@ -749,7 +750,7 @@ impl OutboundPayments {
749750 F : Fn ( SendAlongPathArgs ) -> Result < ( ) , APIError >
750751 {
751752 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 ,
753754 onion_session_privs, node_signer, best_block_height, & send_payment_along_path)
754755 . map_err ( |e| { self . remove_outbound_if_all_failed ( payment_id, & e) ; e } )
755756 }
@@ -794,7 +795,7 @@ impl OutboundPayments {
794795 let onion_session_privs = self . add_new_pending_payment ( payment_hash, recipient_onion. clone ( ) ,
795796 payment_id, Some ( preimage) , & route, None , None , entropy_source, best_block_height) ?;
796797
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 ,
798799 payment_id, None , onion_session_privs, node_signer, best_block_height, & send_payment_along_path
799800 ) {
800801 Ok ( ( ) ) => Ok ( payment_hash) ,
@@ -912,7 +913,7 @@ impl OutboundPayments {
912913 }
913914
914915 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,
916917 Some ( route_params. final_value_msat ) , onion_session_privs, node_signer,
917918 best_block_height, & send_payment_along_path
918919 ) ;
@@ -1154,7 +1155,7 @@ impl OutboundPayments {
11541155 } ) ?;
11551156
11561157 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,
11581159 best_block_height, & send_payment_along_path) ;
11591160 log_info ! ( logger, "Sending payment with id {} and hash {} returned {:?}" ,
11601161 payment_id, payment_hash, res) ;
@@ -1318,7 +1319,7 @@ impl OutboundPayments {
13181319 }
13191320 } ;
13201321 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,
13221323 & send_payment_along_path) ;
13231324 log_info ! ( logger, "Result retrying payment id {}: {:?}" , & payment_id, res) ;
13241325 if let Err ( e) = res {
@@ -1430,7 +1431,8 @@ impl OutboundPayments {
14301431
14311432 let recipient_onion_fields = RecipientOnionFields :: spontaneous_empty ( ) ;
14321433 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
14341436 ) {
14351437 Ok ( ( ) ) => Ok ( ( payment_hash, payment_id) ) ,
14361438 Err ( e) => {
@@ -1539,9 +1541,9 @@ impl OutboundPayments {
15391541
15401542 fn pay_route_internal < NS : Deref , F > (
15411543 & 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
15451547 ) -> Result < ( ) , PaymentSendFailure >
15461548 where
15471549 NS :: Target : NodeSigner ,
@@ -1594,7 +1596,7 @@ impl OutboundPayments {
15941596 for ( path, session_priv_bytes) in route. paths . iter ( ) . zip ( onion_session_privs. into_iter ( ) ) {
15951597 let mut path_res = send_payment_along_path ( SendAlongPathArgs {
15961598 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 ,
15981600 session_priv_bytes
15991601 } ) ;
16001602 match path_res {
@@ -1679,7 +1681,7 @@ impl OutboundPayments {
16791681 F : Fn ( SendAlongPathArgs ) -> Result < ( ) , APIError > ,
16801682 {
16811683 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,
16831685 node_signer, best_block_height, & send_payment_along_path)
16841686 . map_err ( |e| { self . remove_outbound_if_all_failed ( payment_id, & e) ; e } )
16851687 }
0 commit comments