@@ -15,7 +15,7 @@ use bitcoin::secp256k1::{self, Secp256k1, SecretKey};
1515use lightning_invoice:: Bolt11Invoice ;
1616
1717use crate :: blinded_path:: { IntroductionNode , NodeIdLookUp } ;
18- use crate :: events:: { self , PaidBolt12Invoice , PaymentFailureReason } ;
18+ use crate :: events:: { self , PaymentFailureReason } ;
1919use crate :: ln:: channel_state:: ChannelDetails ;
2020use crate :: ln:: channelmanager:: {
2121 EventCompletionAction , HTLCSource , OptionalBolt11PaymentParams , PaymentCompleteUpdate ,
@@ -27,6 +27,7 @@ use crate::ln::onion_utils::{DecodedOnionFailure, HTLCFailReason};
2727use crate :: offers:: invoice:: { Bolt12Invoice , DerivedSigningPubkey , InvoiceBuilder } ;
2828use crate :: offers:: invoice_request:: InvoiceRequest ;
2929use crate :: offers:: nonce:: Nonce ;
30+ use crate :: offers:: payer_proof:: Bolt12InvoiceType ;
3031use crate :: offers:: static_invoice:: StaticInvoice ;
3132use crate :: routing:: router:: {
3233 BlindedTail , InFlightHtlcs , Path , PaymentParameters , Route , RouteParameters ,
@@ -126,7 +127,7 @@ pub(crate) enum PendingOutboundPayment {
126127 invoice_request : Option < InvoiceRequest > ,
127128 // Storing the BOLT 12 invoice here to allow Proof of Payment after
128129 // the payment is made.
129- bolt12_invoice : Option < PaidBolt12Invoice > ,
130+ bolt12_invoice : Option < Bolt12InvoiceType > ,
130131 custom_tlvs : Vec < ( u64 , Vec < u8 > ) > ,
131132 pending_amt_msat : u64 ,
132133 /// Used to track the fee paid. Present iff the payment was serialized on 0.0.103+.
@@ -181,7 +182,7 @@ impl_writeable_tlv_based!(RetryableInvoiceRequest, {
181182} ) ;
182183
183184impl PendingOutboundPayment {
184- fn bolt12_invoice ( & self ) -> Option < & PaidBolt12Invoice > {
185+ fn bolt12_invoice ( & self ) -> Option < & Bolt12InvoiceType > {
185186 match self {
186187 PendingOutboundPayment :: Retryable { bolt12_invoice, .. } => bolt12_invoice. as_ref ( ) ,
187188 _ => None ,
@@ -934,7 +935,7 @@ pub(super) struct SendAlongPathArgs<'a> {
934935 pub payment_id : PaymentId ,
935936 pub keysend_preimage : & ' a Option < PaymentPreimage > ,
936937 pub invoice_request : Option < & ' a InvoiceRequest > ,
937- pub bolt12_invoice : Option < & ' a PaidBolt12Invoice > ,
938+ pub bolt12_invoice : Option < & ' a Bolt12InvoiceType > ,
938939 pub session_priv_bytes : [ u8 ; 32 ] ,
939940 pub hold_htlc_at_next_hop : bool ,
940941}
@@ -1122,7 +1123,7 @@ impl OutboundPayments {
11221123 if let Some ( max_fee_msat) = params_config. max_total_routing_fee_msat {
11231124 route_params. max_total_routing_fee_msat = Some ( max_fee_msat) ;
11241125 }
1125- let invoice = PaidBolt12Invoice :: Bolt12Invoice ( invoice. clone ( ) ) ;
1126+ let invoice = Bolt12InvoiceType :: Bolt12Invoice ( invoice. clone ( ) ) ;
11261127 self . send_payment_for_bolt12_invoice_internal (
11271128 payment_id, payment_hash, None , None , invoice, route_params, retry_strategy, false , router,
11281129 first_hops, inflight_htlcs, entropy_source, node_signer, node_id_lookup, secp_ctx,
@@ -1136,7 +1137,7 @@ impl OutboundPayments {
11361137 > (
11371138 & self , payment_id : PaymentId , payment_hash : PaymentHash ,
11381139 keysend_preimage : Option < PaymentPreimage > , invoice_request : Option < & InvoiceRequest > ,
1139- bolt12_invoice : PaidBolt12Invoice ,
1140+ bolt12_invoice : Bolt12InvoiceType ,
11401141 mut route_params : RouteParameters , retry_strategy : Retry , hold_htlcs_at_next_hop : bool , router : & R ,
11411142 first_hops : Vec < ChannelDetails > , inflight_htlcs : IH , entropy_source : & ES , node_signer : & NS ,
11421143 node_id_lookup : & NL , secp_ctx : & Secp256k1 < secp256k1:: All > , best_block_height : u32 ,
@@ -1395,7 +1396,7 @@ impl OutboundPayments {
13951396 retry_strategy = Retry :: Attempts ( 0 ) ;
13961397 }
13971398
1398- let invoice = PaidBolt12Invoice :: StaticInvoice ( invoice) ;
1399+ let invoice = Bolt12InvoiceType :: StaticInvoice ( invoice) ;
13991400 self . send_payment_for_bolt12_invoice_internal (
14001401 payment_id,
14011402 payment_hash,
@@ -1977,7 +1978,7 @@ impl OutboundPayments {
19771978 & self , payment_hash : PaymentHash , recipient_onion : RecipientOnionFields , payment_id : PaymentId ,
19781979 keysend_preimage : Option < PaymentPreimage > , route : & Route , retry_strategy : Option < Retry > ,
19791980 payment_params : Option < PaymentParameters > , entropy_source : & ES , best_block_height : u32 ,
1980- bolt12_invoice : Option < PaidBolt12Invoice >
1981+ bolt12_invoice : Option < Bolt12InvoiceType >
19811982 ) -> Result < Vec < [ u8 ; 32 ] > , PaymentSendFailure > {
19821983 let mut pending_outbounds = self . pending_outbound_payments . lock ( ) . unwrap ( ) ;
19831984 match pending_outbounds. entry ( payment_id) {
@@ -1997,7 +1998,7 @@ impl OutboundPayments {
19971998 fn create_pending_payment < ES : EntropySource > (
19981999 payment_hash : PaymentHash , recipient_onion : RecipientOnionFields ,
19992000 keysend_preimage : Option < PaymentPreimage > , invoice_request : Option < InvoiceRequest > ,
2000- bolt12_invoice : Option < PaidBolt12Invoice > , route : & Route , retry_strategy : Option < Retry > ,
2001+ bolt12_invoice : Option < Bolt12InvoiceType > , route : & Route , retry_strategy : Option < Retry > ,
20012002 payment_params : Option < PaymentParameters > , entropy_source : & ES , best_block_height : u32
20022003 ) -> ( PendingOutboundPayment , Vec < [ u8 ; 32 ] > ) {
20032004 let mut onion_session_privs = Vec :: with_capacity ( route. paths . len ( ) ) ;
@@ -2107,7 +2108,7 @@ impl OutboundPayments {
21072108 #[ rustfmt:: skip]
21082109 fn pay_route_internal < NS : NodeSigner , F > (
21092110 & self , route : & Route , payment_hash : PaymentHash , recipient_onion : & RecipientOnionFields ,
2110- keysend_preimage : Option < PaymentPreimage > , invoice_request : Option < & InvoiceRequest > , bolt12_invoice : Option < & PaidBolt12Invoice > ,
2111+ keysend_preimage : Option < PaymentPreimage > , invoice_request : Option < & InvoiceRequest > , bolt12_invoice : Option < & Bolt12InvoiceType > ,
21112112 payment_id : PaymentId , onion_session_privs : & Vec < [ u8 ; 32 ] > ,
21122113 hold_htlcs_at_next_hop : bool , node_signer : & NS , best_block_height : u32 , send_payment_along_path : & F
21132114 ) -> Result < ( ) , PaymentSendFailure >
@@ -2247,7 +2248,7 @@ impl OutboundPayments {
22472248
22482249 #[ rustfmt:: skip]
22492250 pub ( super ) fn claim_htlc < L : Logger > (
2250- & self , payment_id : PaymentId , payment_preimage : PaymentPreimage , bolt12_invoice : Option < PaidBolt12Invoice > ,
2251+ & self , payment_id : PaymentId , payment_preimage : PaymentPreimage , bolt12_invoice : Option < Bolt12InvoiceType > ,
22512252 session_priv : SecretKey , path : Path , from_onchain : bool , ev_completion_action : & mut Option < EventCompletionAction > ,
22522253 pending_events : & Mutex < VecDeque < ( events:: Event , Option < EventCompletionAction > ) > > ,
22532254 logger : & WithContext < L > ,
0 commit comments