@@ -24,6 +24,7 @@ use crate::ln::onion_utils::{DecodedOnionFailure, HTLCFailReason};
2424use crate :: offers:: invoice:: Bolt12Invoice ;
2525use crate :: offers:: invoice_request:: InvoiceRequest ;
2626use crate :: offers:: nonce:: Nonce ;
27+ use crate :: offers:: OfferInvoice ;
2728use crate :: routing:: router:: { BlindedTail , InFlightHtlcs , RouteParametersConfig , Path , PaymentParameters , Route , RouteParameters , Router } ;
2829use crate :: sign:: { EntropySource , NodeSigner , Recipient } ;
2930use crate :: util:: errors:: APIError ;
@@ -107,7 +108,7 @@ pub(crate) enum PendingOutboundPayment {
107108 invoice_request : Option < InvoiceRequest > ,
108109 // Storing the bolt12 invoice here to allow Proof of Payment after
109110 // the payment is made.
110- bolt12_invoice : Option < Bolt12Invoice > ,
111+ bolt12_invoice : Option < OfferInvoice > ,
111112 custom_tlvs : Vec < ( u64 , Vec < u8 > ) > ,
112113 pending_amt_msat : u64 ,
113114 /// Used to track the fee paid. Present iff the payment was serialized on 0.0.103+.
@@ -157,7 +158,7 @@ impl_writeable_tlv_based!(RetryableInvoiceRequest, {
157158} ) ;
158159
159160impl PendingOutboundPayment {
160- fn bolt12_invoice ( & self ) -> Option < & Bolt12Invoice > {
161+ fn bolt12_invoice ( & self ) -> Option < & OfferInvoice > {
161162 match self {
162163 PendingOutboundPayment :: Retryable { bolt12_invoice, .. } => bolt12_invoice. as_ref ( ) ,
163164 _ => None ,
@@ -906,8 +907,9 @@ impl OutboundPayments {
906907 if let Some ( max_fee_msat) = params_config. max_total_routing_fee_msat {
907908 route_params. max_total_routing_fee_msat = Some ( max_fee_msat) ;
908909 }
910+ let invoice = OfferInvoice :: Bolt12Invoice ( invoice. clone ( ) ) ;
909911 self . send_payment_for_bolt12_invoice_internal (
910- payment_id, payment_hash, None , None , Some ( invoice) , route_params, retry_strategy, router, first_hops,
912+ payment_id, payment_hash, None , None , Some ( & invoice) , route_params, retry_strategy, router, first_hops,
911913 inflight_htlcs, entropy_source, node_signer, node_id_lookup, secp_ctx, best_block_height,
912914 logger, pending_events, send_payment_along_path
913915 )
@@ -918,7 +920,7 @@ impl OutboundPayments {
918920 > (
919921 & self , payment_id : PaymentId , payment_hash : PaymentHash ,
920922 keysend_preimage : Option < PaymentPreimage > , invoice_request : Option < & InvoiceRequest > ,
921- bolt12_invoice : Option < & Bolt12Invoice > ,
923+ bolt12_invoice : Option < & OfferInvoice > ,
922924 mut route_params : RouteParameters , retry_strategy : Retry , router : & R ,
923925 first_hops : Vec < ChannelDetails > , inflight_htlcs : IH , entropy_source : & ES , node_signer : & NS ,
924926 node_id_lookup : & NL , secp_ctx : & Secp256k1 < secp256k1:: All > , best_block_height : u32 , logger : & L ,
@@ -1665,7 +1667,7 @@ impl OutboundPayments {
16651667 & self , payment_hash : PaymentHash , recipient_onion : RecipientOnionFields , payment_id : PaymentId ,
16661668 keysend_preimage : Option < PaymentPreimage > , route : & Route , retry_strategy : Option < Retry > ,
16671669 payment_params : Option < PaymentParameters > , entropy_source : & ES , best_block_height : u32 ,
1668- bolt12_invoice : Option < Bolt12Invoice >
1670+ bolt12_invoice : Option < OfferInvoice >
16691671 ) -> Result < Vec < [ u8 ; 32 ] > , PaymentSendFailure > where ES :: Target : EntropySource {
16701672 let mut pending_outbounds = self . pending_outbound_payments . lock ( ) . unwrap ( ) ;
16711673 match pending_outbounds. entry ( payment_id) {
@@ -1684,7 +1686,7 @@ impl OutboundPayments {
16841686 fn create_pending_payment < ES : Deref > (
16851687 payment_hash : PaymentHash , recipient_onion : RecipientOnionFields ,
16861688 keysend_preimage : Option < PaymentPreimage > , invoice_request : Option < InvoiceRequest > ,
1687- bolt12_invoice : Option < Bolt12Invoice > , route : & Route , retry_strategy : Option < Retry > ,
1689+ bolt12_invoice : Option < OfferInvoice > , route : & Route , retry_strategy : Option < Retry > ,
16881690 payment_params : Option < PaymentParameters > , entropy_source : & ES , best_block_height : u32
16891691 ) -> ( PendingOutboundPayment , Vec < [ u8 ; 32 ] > )
16901692 where
0 commit comments