@@ -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 , PaymentFailureReason } ;
18+ use crate :: events:: { self , PaymentFailureReason , PaidInvoice } ;
1919use crate :: types:: payment:: { PaymentHash , PaymentPreimage , PaymentSecret } ;
2020use crate :: ln:: channel_state:: ChannelDetails ;
2121use crate :: ln:: channelmanager:: { EventCompletionAction , HTLCSource , PaymentId } ;
@@ -108,7 +108,7 @@ pub(crate) enum PendingOutboundPayment {
108108 invoice_request : Option < InvoiceRequest > ,
109109 // Storing the bolt12 invoice here to allow Proof of Payment after
110110 // the payment is made.
111- bolt12_invoice : Option < Bolt12Invoice > ,
111+ bolt12_invoice : Option < PaidInvoice > ,
112112 custom_tlvs : Vec < ( u64 , Vec < u8 > ) > ,
113113 pending_amt_msat : u64 ,
114114 /// Used to track the fee paid. Present iff the payment was serialized on 0.0.103+.
@@ -158,7 +158,7 @@ impl_writeable_tlv_based!(RetryableInvoiceRequest, {
158158} ) ;
159159
160160impl PendingOutboundPayment {
161- fn bolt12_invoice ( & self ) -> Option < & Bolt12Invoice > {
161+ fn bolt12_invoice ( & self ) -> Option < & PaidInvoice > {
162162 match self {
163163 PendingOutboundPayment :: Retryable { bolt12_invoice, .. } => bolt12_invoice. as_ref ( ) ,
164164 _ => None ,
@@ -967,8 +967,9 @@ impl OutboundPayments {
967967 if let Some ( max_fee_msat) = params_config. max_total_routing_fee_msat {
968968 route_params. max_total_routing_fee_msat = Some ( max_fee_msat) ;
969969 }
970+ let invoice = PaidInvoice :: Bolt12Invoice ( invoice. clone ( ) ) ;
970971 self . send_payment_for_bolt12_invoice_internal (
971- payment_id, payment_hash, None , None , Some ( invoice) , route_params, retry_strategy, router, first_hops,
972+ payment_id, payment_hash, None , None , Some ( & invoice) , route_params, retry_strategy, router, first_hops,
972973 inflight_htlcs, entropy_source, node_signer, node_id_lookup, secp_ctx, best_block_height,
973974 logger, pending_events, send_payment_along_path
974975 )
@@ -979,7 +980,7 @@ impl OutboundPayments {
979980 > (
980981 & self , payment_id : PaymentId , payment_hash : PaymentHash ,
981982 keysend_preimage : Option < PaymentPreimage > , invoice_request : Option < & InvoiceRequest > ,
982- bolt12_invoice : Option < & Bolt12Invoice > ,
983+ bolt12_invoice : Option < & PaidInvoice > ,
983984 mut route_params : RouteParameters , retry_strategy : Retry , router : & R ,
984985 first_hops : Vec < ChannelDetails > , inflight_htlcs : IH , entropy_source : & ES , node_signer : & NS ,
985986 node_id_lookup : & NL , secp_ctx : & Secp256k1 < secp256k1:: All > , best_block_height : u32 , logger : & L ,
@@ -1726,7 +1727,7 @@ impl OutboundPayments {
17261727 & self , payment_hash : PaymentHash , recipient_onion : RecipientOnionFields , payment_id : PaymentId ,
17271728 keysend_preimage : Option < PaymentPreimage > , route : & Route , retry_strategy : Option < Retry > ,
17281729 payment_params : Option < PaymentParameters > , entropy_source : & ES , best_block_height : u32 ,
1729- bolt12_invoice : Option < Bolt12Invoice >
1730+ bolt12_invoice : Option < PaidInvoice >
17301731 ) -> Result < Vec < [ u8 ; 32 ] > , PaymentSendFailure > where ES :: Target : EntropySource {
17311732 let mut pending_outbounds = self . pending_outbound_payments . lock ( ) . unwrap ( ) ;
17321733 match pending_outbounds. entry ( payment_id) {
@@ -1745,7 +1746,7 @@ impl OutboundPayments {
17451746 fn create_pending_payment < ES : Deref > (
17461747 payment_hash : PaymentHash , recipient_onion : RecipientOnionFields ,
17471748 keysend_preimage : Option < PaymentPreimage > , invoice_request : Option < InvoiceRequest > ,
1748- bolt12_invoice : Option < Bolt12Invoice > , route : & Route , retry_strategy : Option < Retry > ,
1749+ bolt12_invoice : Option < PaidInvoice > , route : & Route , retry_strategy : Option < Retry > ,
17491750 payment_params : Option < PaymentParameters > , entropy_source : & ES , best_block_height : u32
17501751 ) -> ( PendingOutboundPayment , Vec < [ u8 ; 32 ] > )
17511752 where
0 commit comments