@@ -715,6 +715,7 @@ pub(super) struct SendAlongPathArgs<'a> {
715715 pub cur_height : u32 ,
716716 pub payment_id : PaymentId ,
717717 pub keysend_preimage : & ' a Option < PaymentPreimage > ,
718+ pub invoice_request : Option < & ' a InvoiceRequest > ,
718719 pub session_priv_bytes : [ u8 ; 32 ] ,
719720}
720721
@@ -768,7 +769,7 @@ impl OutboundPayments {
768769 F : Fn ( SendAlongPathArgs ) -> Result < ( ) , APIError >
769770 {
770771 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 ,
772773 onion_session_privs, node_signer, best_block_height, & send_payment_along_path)
773774 . map_err ( |e| { self . remove_outbound_if_all_failed ( payment_id, & e) ; e } )
774775 }
@@ -813,7 +814,7 @@ impl OutboundPayments {
813814 let onion_session_privs = self . add_new_pending_payment ( payment_hash, recipient_onion. clone ( ) ,
814815 payment_id, Some ( preimage) , & route, None , None , entropy_source, best_block_height) ?;
815816
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 ,
817818 payment_id, None , onion_session_privs, node_signer, best_block_height, & send_payment_along_path
818819 ) {
819820 Ok ( ( ) ) => Ok ( payment_hash) ,
@@ -961,7 +962,7 @@ impl OutboundPayments {
961962 }
962963
963964 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,
965966 Some ( route_params. final_value_msat ) , onion_session_privs, node_signer,
966967 best_block_height, & send_payment_along_path
967968 ) ;
@@ -1241,7 +1242,7 @@ impl OutboundPayments {
12411242 } ) ?;
12421243
12431244 let res = self . pay_route_internal ( & route, payment_hash, & recipient_onion,
1244- keysend_preimage, payment_id, None , onion_session_privs, node_signer,
1245+ keysend_preimage, None , payment_id, None , onion_session_privs, node_signer,
12451246 best_block_height, & send_payment_along_path) ;
12461247 log_info ! ( logger, "Sending payment with id {} and hash {} returned {:?}" ,
12471248 payment_id, payment_hash, res) ;
@@ -1395,7 +1396,7 @@ impl OutboundPayments {
13951396 }
13961397 } ;
13971398 let res = self . pay_route_internal ( & route, payment_hash, & recipient_onion, keysend_preimage,
1398- payment_id, Some ( total_msat) , onion_session_privs, node_signer, best_block_height,
1399+ None , payment_id, Some ( total_msat) , onion_session_privs, node_signer, best_block_height,
13991400 & send_payment_along_path) ;
14001401 log_info ! ( logger, "Result retrying payment id {}: {:?}" , & payment_id, res) ;
14011402 if let Err ( e) = res {
@@ -1507,7 +1508,8 @@ impl OutboundPayments {
15071508
15081509 let recipient_onion_fields = RecipientOnionFields :: spontaneous_empty ( ) ;
15091510 match self . pay_route_internal ( & route, payment_hash, & recipient_onion_fields,
1510- None , payment_id, None , onion_session_privs, node_signer, best_block_height, & send_payment_along_path
1511+ None , None , payment_id, None , onion_session_privs, node_signer, best_block_height,
1512+ & send_payment_along_path
15111513 ) {
15121514 Ok ( ( ) ) => Ok ( ( payment_hash, payment_id) ) ,
15131515 Err ( e) => {
@@ -1619,9 +1621,9 @@ impl OutboundPayments {
16191621
16201622 fn pay_route_internal < NS : Deref , F > (
16211623 & self , route : & Route , payment_hash : PaymentHash , recipient_onion : & RecipientOnionFields ,
1622- keysend_preimage : Option < PaymentPreimage > , payment_id : PaymentId , recv_value_msat : Option < u64 > ,
1623- onion_session_privs : Vec < [ u8 ; 32 ] > , node_signer : & NS , best_block_height : u32 ,
1624- send_payment_along_path : & F
1624+ keysend_preimage : Option < PaymentPreimage > , invoice_request : Option < & InvoiceRequest > ,
1625+ payment_id : PaymentId , recv_value_msat : Option < u64 > , onion_session_privs : Vec < [ u8 ; 32 ] > ,
1626+ node_signer : & NS , best_block_height : u32 , send_payment_along_path : & F
16251627 ) -> Result < ( ) , PaymentSendFailure >
16261628 where
16271629 NS :: Target : NodeSigner ,
@@ -1674,7 +1676,7 @@ impl OutboundPayments {
16741676 for ( path, session_priv_bytes) in route. paths . iter ( ) . zip ( onion_session_privs. into_iter ( ) ) {
16751677 let mut path_res = send_payment_along_path ( SendAlongPathArgs {
16761678 path : & path, payment_hash : & payment_hash, recipient_onion, total_value,
1677- cur_height, payment_id, keysend_preimage : & keysend_preimage,
1679+ cur_height, payment_id, keysend_preimage : & keysend_preimage, invoice_request ,
16781680 session_priv_bytes
16791681 } ) ;
16801682 match path_res {
@@ -1759,7 +1761,7 @@ impl OutboundPayments {
17591761 F : Fn ( SendAlongPathArgs ) -> Result < ( ) , APIError > ,
17601762 {
17611763 self . pay_route_internal ( route, payment_hash, & recipient_onion,
1762- keysend_preimage, payment_id, recv_value_msat, onion_session_privs,
1764+ keysend_preimage, None , payment_id, recv_value_msat, onion_session_privs,
17631765 node_signer, best_block_height, & send_payment_along_path)
17641766 . map_err ( |e| { self . remove_outbound_if_all_failed ( payment_id, & e) ; e } )
17651767 }
0 commit comments