@@ -687,6 +687,7 @@ pub(super) struct SendAlongPathArgs<'a> {
687687 pub cur_height : u32 ,
688688 pub payment_id : PaymentId ,
689689 pub keysend_preimage : & ' a Option < PaymentPreimage > ,
690+ pub invoice_request : Option < & ' a InvoiceRequest > ,
690691 pub session_priv_bytes : [ u8 ; 32 ] ,
691692}
692693
@@ -734,7 +735,7 @@ impl OutboundPayments {
734735 F : Fn ( SendAlongPathArgs ) -> Result < ( ) , APIError >
735736 {
736737 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) ?;
737- self . pay_route_internal ( route, payment_hash, & recipient_onion, None , payment_id, None ,
738+ self . pay_route_internal ( route, payment_hash, & recipient_onion, None , None , payment_id, None ,
738739 onion_session_privs, node_signer, best_block_height, & send_payment_along_path)
739740 . map_err ( |e| { self . remove_outbound_if_all_failed ( payment_id, & e) ; e } )
740741 }
@@ -779,7 +780,7 @@ impl OutboundPayments {
779780 let onion_session_privs = self . add_new_pending_payment ( payment_hash, recipient_onion. clone ( ) ,
780781 payment_id, Some ( preimage) , & route, None , None , entropy_source, best_block_height) ?;
781782
782- match self . pay_route_internal ( route, payment_hash, & recipient_onion, Some ( preimage) ,
783+ match self . pay_route_internal ( route, payment_hash, & recipient_onion, Some ( preimage) , None ,
783784 payment_id, None , onion_session_privs, node_signer, best_block_height, & send_payment_along_path
784785 ) {
785786 Ok ( ( ) ) => Ok ( payment_hash) ,
@@ -904,7 +905,7 @@ impl OutboundPayments {
904905 }
905906
906907 let result = self . pay_route_internal (
907- & route, payment_hash, & recipient_onion, None , payment_id,
908+ & route, payment_hash, & recipient_onion, None , None , payment_id,
908909 Some ( route_params. final_value_msat ) , onion_session_privs, node_signer,
909910 best_block_height, & send_payment_along_path
910911 ) ;
@@ -1180,7 +1181,7 @@ impl OutboundPayments {
11801181 } ) ?;
11811182
11821183 let res = self . pay_route_internal ( & route, payment_hash, & recipient_onion,
1183- keysend_preimage, payment_id, None , onion_session_privs, node_signer,
1184+ keysend_preimage, None , payment_id, None , onion_session_privs, node_signer,
11841185 best_block_height, & send_payment_along_path) ;
11851186 log_info ! ( logger, "Sending payment with id {} and hash {} returned {:?}" ,
11861187 payment_id, payment_hash, res) ;
@@ -1344,7 +1345,7 @@ impl OutboundPayments {
13441345 }
13451346 } ;
13461347 let res = self . pay_route_internal ( & route, payment_hash, & recipient_onion, keysend_preimage,
1347- payment_id, Some ( total_msat) , onion_session_privs, node_signer, best_block_height,
1348+ None , payment_id, Some ( total_msat) , onion_session_privs, node_signer, best_block_height,
13481349 & send_payment_along_path) ;
13491350 log_info ! ( logger, "Result retrying payment id {}: {:?}" , & payment_id, res) ;
13501351 if let Err ( e) = res {
@@ -1456,7 +1457,8 @@ impl OutboundPayments {
14561457
14571458 let recipient_onion_fields = RecipientOnionFields :: spontaneous_empty ( ) ;
14581459 match self . pay_route_internal ( & route, payment_hash, & recipient_onion_fields,
1459- None , payment_id, None , onion_session_privs, node_signer, best_block_height, & send_payment_along_path
1460+ None , None , payment_id, None , onion_session_privs, node_signer, best_block_height,
1461+ & send_payment_along_path
14601462 ) {
14611463 Ok ( ( ) ) => Ok ( ( payment_hash, payment_id) ) ,
14621464 Err ( e) => {
@@ -1565,9 +1567,9 @@ impl OutboundPayments {
15651567
15661568 fn pay_route_internal < NS : Deref , F > (
15671569 & self , route : & Route , payment_hash : PaymentHash , recipient_onion : & RecipientOnionFields ,
1568- keysend_preimage : Option < PaymentPreimage > , payment_id : PaymentId , recv_value_msat : Option < u64 > ,
1569- onion_session_privs : Vec < [ u8 ; 32 ] > , node_signer : & NS , best_block_height : u32 ,
1570- send_payment_along_path : & F
1570+ keysend_preimage : Option < PaymentPreimage > , invoice_request : Option < & InvoiceRequest > ,
1571+ payment_id : PaymentId , recv_value_msat : Option < u64 > , onion_session_privs : Vec < [ u8 ; 32 ] > ,
1572+ node_signer : & NS , best_block_height : u32 , send_payment_along_path : & F
15711573 ) -> Result < ( ) , PaymentSendFailure >
15721574 where
15731575 NS :: Target : NodeSigner ,
@@ -1620,7 +1622,7 @@ impl OutboundPayments {
16201622 for ( path, session_priv_bytes) in route. paths . iter ( ) . zip ( onion_session_privs. into_iter ( ) ) {
16211623 let mut path_res = send_payment_along_path ( SendAlongPathArgs {
16221624 path : & path, payment_hash : & payment_hash, recipient_onion, total_value,
1623- cur_height, payment_id, keysend_preimage : & keysend_preimage,
1625+ cur_height, payment_id, keysend_preimage : & keysend_preimage, invoice_request ,
16241626 session_priv_bytes
16251627 } ) ;
16261628 match path_res {
@@ -1705,7 +1707,7 @@ impl OutboundPayments {
17051707 F : Fn ( SendAlongPathArgs ) -> Result < ( ) , APIError > ,
17061708 {
17071709 self . pay_route_internal ( route, payment_hash, & recipient_onion,
1708- keysend_preimage, payment_id, recv_value_msat, onion_session_privs,
1710+ keysend_preimage, None , payment_id, recv_value_msat, onion_session_privs,
17091711 node_signer, best_block_height, & send_payment_along_path)
17101712 . map_err ( |e| { self . remove_outbound_if_all_failed ( payment_id, & e) ; e } )
17111713 }
0 commit comments