@@ -24,6 +24,7 @@ use crate::ln::onion_utils::{DecodedOnionFailure, HTLCFailReason};
24
24
use crate :: offers:: invoice:: Bolt12Invoice ;
25
25
use crate :: offers:: invoice_request:: InvoiceRequest ;
26
26
use crate :: offers:: nonce:: Nonce ;
27
+ use crate :: offers:: OfferInvoice ;
27
28
use crate :: routing:: router:: { BlindedTail , InFlightHtlcs , RouteParametersConfig , Path , PaymentParameters , Route , RouteParameters , Router } ;
28
29
use crate :: sign:: { EntropySource , NodeSigner , Recipient } ;
29
30
use crate :: util:: errors:: APIError ;
@@ -107,7 +108,7 @@ pub(crate) enum PendingOutboundPayment {
107
108
invoice_request : Option < InvoiceRequest > ,
108
109
// Storing the bolt12 invoice here to allow Proof of Payment after
109
110
// the payment is made.
110
- bolt12_invoice : Option < Bolt12Invoice > ,
111
+ bolt12_invoice : Option < OfferInvoice > ,
111
112
custom_tlvs : Vec < ( u64 , Vec < u8 > ) > ,
112
113
pending_amt_msat : u64 ,
113
114
/// 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, {
157
158
} ) ;
158
159
159
160
impl PendingOutboundPayment {
160
- fn bolt12_invoice ( & self ) -> Option < & Bolt12Invoice > {
161
+ fn bolt12_invoice ( & self ) -> Option < & OfferInvoice > {
161
162
match self {
162
163
PendingOutboundPayment :: Retryable { bolt12_invoice, .. } => bolt12_invoice. as_ref ( ) ,
163
164
_ => None ,
@@ -906,8 +907,9 @@ impl OutboundPayments {
906
907
if let Some ( max_fee_msat) = params_config. max_total_routing_fee_msat {
907
908
route_params. max_total_routing_fee_msat = Some ( max_fee_msat) ;
908
909
}
910
+ let invoice = OfferInvoice :: Bolt12Invoice ( invoice. clone ( ) ) ;
909
911
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,
911
913
inflight_htlcs, entropy_source, node_signer, node_id_lookup, secp_ctx, best_block_height,
912
914
logger, pending_events, send_payment_along_path
913
915
)
@@ -918,7 +920,7 @@ impl OutboundPayments {
918
920
> (
919
921
& self , payment_id : PaymentId , payment_hash : PaymentHash ,
920
922
keysend_preimage : Option < PaymentPreimage > , invoice_request : Option < & InvoiceRequest > ,
921
- bolt12_invoice : Option < & Bolt12Invoice > ,
923
+ bolt12_invoice : Option < & OfferInvoice > ,
922
924
mut route_params : RouteParameters , retry_strategy : Retry , router : & R ,
923
925
first_hops : Vec < ChannelDetails > , inflight_htlcs : IH , entropy_source : & ES , node_signer : & NS ,
924
926
node_id_lookup : & NL , secp_ctx : & Secp256k1 < secp256k1:: All > , best_block_height : u32 , logger : & L ,
@@ -1665,7 +1667,7 @@ impl OutboundPayments {
1665
1667
& self , payment_hash : PaymentHash , recipient_onion : RecipientOnionFields , payment_id : PaymentId ,
1666
1668
keysend_preimage : Option < PaymentPreimage > , route : & Route , retry_strategy : Option < Retry > ,
1667
1669
payment_params : Option < PaymentParameters > , entropy_source : & ES , best_block_height : u32 ,
1668
- bolt12_invoice : Option < Bolt12Invoice >
1670
+ bolt12_invoice : Option < OfferInvoice >
1669
1671
) -> Result < Vec < [ u8 ; 32 ] > , PaymentSendFailure > where ES :: Target : EntropySource {
1670
1672
let mut pending_outbounds = self . pending_outbound_payments . lock ( ) . unwrap ( ) ;
1671
1673
match pending_outbounds. entry ( payment_id) {
@@ -1684,7 +1686,7 @@ impl OutboundPayments {
1684
1686
fn create_pending_payment < ES : Deref > (
1685
1687
payment_hash : PaymentHash , recipient_onion : RecipientOnionFields ,
1686
1688
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 > ,
1688
1690
payment_params : Option < PaymentParameters > , entropy_source : & ES , best_block_height : u32
1689
1691
) -> ( PendingOutboundPayment , Vec < [ u8 ; 32 ] > )
1690
1692
where
0 commit comments