@@ -716,6 +716,7 @@ pub(super) struct SendAlongPathArgs<'a> {
716716 pub cur_height : u32 ,
717717 pub payment_id : PaymentId ,
718718 pub keysend_preimage : & ' a Option < PaymentPreimage > ,
719+ pub invoice_request : Option < & ' a InvoiceRequest > ,
719720 pub session_priv_bytes : [ u8 ; 32 ] ,
720721}
721722
@@ -769,7 +770,7 @@ impl OutboundPayments {
769770 F : Fn ( SendAlongPathArgs ) -> Result < ( ) , APIError >
770771 {
771772 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 ,
773774 onion_session_privs, node_signer, best_block_height, & send_payment_along_path)
774775 . map_err ( |e| { self . remove_outbound_if_all_failed ( payment_id, & e) ; e } )
775776 }
@@ -814,7 +815,7 @@ impl OutboundPayments {
814815 let onion_session_privs = self . add_new_pending_payment ( payment_hash, recipient_onion. clone ( ) ,
815816 payment_id, Some ( preimage) , & route, None , None , entropy_source, best_block_height) ?;
816817
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 ,
818819 payment_id, None , onion_session_privs, node_signer, best_block_height, & send_payment_along_path
819820 ) {
820821 Ok ( ( ) ) => Ok ( payment_hash) ,
@@ -962,7 +963,7 @@ impl OutboundPayments {
962963 }
963964
964965 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,
966967 Some ( route_params. final_value_msat ) , onion_session_privs, node_signer,
967968 best_block_height, & send_payment_along_path
968969 ) ;
@@ -1242,7 +1243,7 @@ impl OutboundPayments {
12421243 } ) ?;
12431244
12441245 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,
12461247 best_block_height, & send_payment_along_path) ;
12471248 log_info ! ( logger, "Sending payment with id {} and hash {} returned {:?}" ,
12481249 payment_id, payment_hash, res) ;
@@ -1396,7 +1397,7 @@ impl OutboundPayments {
13961397 }
13971398 } ;
13981399 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,
14001401 & send_payment_along_path) ;
14011402 log_info ! ( logger, "Result retrying payment id {}: {:?}" , & payment_id, res) ;
14021403 if let Err ( e) = res {
@@ -1508,7 +1509,8 @@ impl OutboundPayments {
15081509
15091510 let recipient_onion_fields = RecipientOnionFields :: spontaneous_empty ( ) ;
15101511 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
15121514 ) {
15131515 Ok ( ( ) ) => Ok ( ( payment_hash, payment_id) ) ,
15141516 Err ( e) => {
@@ -1620,9 +1622,9 @@ impl OutboundPayments {
16201622
16211623 fn pay_route_internal < NS : Deref , F > (
16221624 & 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
16261628 ) -> Result < ( ) , PaymentSendFailure >
16271629 where
16281630 NS :: Target : NodeSigner ,
@@ -1675,7 +1677,7 @@ impl OutboundPayments {
16751677 for ( path, session_priv_bytes) in route. paths . iter ( ) . zip ( onion_session_privs. into_iter ( ) ) {
16761678 let mut path_res = send_payment_along_path ( SendAlongPathArgs {
16771679 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 ,
16791681 session_priv_bytes
16801682 } ) ;
16811683 match path_res {
@@ -1760,7 +1762,7 @@ impl OutboundPayments {
17601762 F : Fn ( SendAlongPathArgs ) -> Result < ( ) , APIError > ,
17611763 {
17621764 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,
17641766 node_signer, best_block_height, & send_payment_along_path)
17651767 . map_err ( |e| { self . remove_outbound_if_all_failed ( payment_id, & e) ; e } )
17661768 }
0 commit comments