@@ -64,15 +64,12 @@ use crate::ln::outbound_payment;
6464use crate::ln::outbound_payment::{OutboundPayments, PendingOutboundPayment, RetryableInvoiceRequest, SendAlongPathArgs, StaleExpiration};
6565use crate::offers::invoice::Bolt12Invoice;
6666use crate::offers::invoice::UnsignedBolt12Invoice;
67- use crate::offers::invoice_request::InvoiceRequest;
6867use crate::offers::nonce::Nonce;
69- use crate::offers::parse::Bolt12SemanticError;
7068use crate::offers::signer;
7169#[cfg(async_payments)]
7270use crate::offers::static_invoice::StaticInvoice;
7371use crate::onion_message::async_payments::{AsyncPaymentsMessage, HeldHtlcAvailable, ReleaseHeldHtlc, AsyncPaymentsMessageHandler};
74- use crate::onion_message::messenger::{DefaultMessageRouter, Destination, MessageRouter, MessageSendInstructions, Responder, ResponseInstruction};
75- use crate::onion_message::offers::OffersMessage;
72+ use crate::onion_message::messenger::{DefaultMessageRouter, MessageRouter, MessageSendInstructions, Responder, ResponseInstruction};
7673use crate::sign::{EntropySource, NodeSigner, Recipient, SignerProvider};
7774use crate::sign::ecdsa::EcdsaChannelSigner;
7875use crate::util::config::{UserConfig, ChannelConfig, ChannelConfigUpdate};
@@ -2113,8 +2110,6 @@ where
21132110//
21142111// Lock order tree:
21152112//
2116- // `pending_offers_messages`
2117- //
21182113// `pending_async_payments_messages`
21192114//
21202115// `total_consistency_lock`
@@ -2363,10 +2358,6 @@ where
23632358 event_persist_notifier: Notifier,
23642359 needs_persist_flag: AtomicBool,
23652360
2366- #[cfg(not(any(test, feature = "_test_utils")))]
2367- pending_offers_messages: Mutex<Vec<(OffersMessage, MessageSendInstructions)>>,
2368- #[cfg(any(test, feature = "_test_utils"))]
2369- pub(crate) pending_offers_messages: Mutex<Vec<(OffersMessage, MessageSendInstructions)>>,
23702361 pending_async_payments_messages: Mutex<Vec<(AsyncPaymentsMessage, MessageSendInstructions)>>,
23712362
23722363 /// Tracks the message events that are to be broadcasted when we are connected to some peer.
@@ -3229,7 +3220,6 @@ where
32293220 needs_persist_flag: AtomicBool::new(false),
32303221 funding_batch_states: Mutex::new(BTreeMap::new()),
32313222
3232- pending_offers_messages: Mutex::new(Vec::new()),
32333223 pending_async_payments_messages: Mutex::new(Vec::new()),
32343224 pending_broadcast_messages: Mutex::new(Vec::new()),
32353225
@@ -9475,9 +9465,6 @@ impl Default for Bolt11InvoiceParameters {
94759465///
94769466/// [`OffersMessageFlow`]: crate::offers::flow::OffersMessageFlow
94779467pub trait OffersMessageCommons {
9478- /// Get pending offers messages
9479- fn get_pending_offers_messages(&self) -> MutexGuard<'_, Vec<(OffersMessage, MessageSendInstructions)>>;
9480-
94819468 #[cfg(feature = "dnssec")]
94829469 /// Get pending DNS onion messages
94839470 fn get_pending_dns_onion_messages(&self) -> MutexGuard<'_, Vec<(DNSResolverMessage, MessageSendInstructions)>>;
@@ -9575,13 +9562,6 @@ pub trait OffersMessageCommons {
95759562 /// Errors if the `MessageRouter` errors.
95769563 fn create_blinded_paths(&self, context: MessageContext) -> Result<Vec<BlindedMessagePath>, ()>;
95779564
9578- /// Enqueue invoice request
9579- fn enqueue_invoice_request(
9580- &self,
9581- invoice_request: InvoiceRequest,
9582- reply_paths: Vec<BlindedMessagePath>,
9583- ) -> Result<(), Bolt12SemanticError>;
9584-
95859565 /// Get the current time determined by highest seen timestamp
95869566 fn get_current_blocktime(&self) -> Duration;
95879567
@@ -9621,10 +9601,6 @@ where
96219601 MR::Target: MessageRouter,
96229602 L::Target: Logger,
96239603{
9624- fn get_pending_offers_messages(&self) -> MutexGuard<'_, Vec<(OffersMessage, MessageSendInstructions)>> {
9625- self.pending_offers_messages.lock().expect("Mutex is locked by other thread.")
9626- }
9627-
96289604 #[cfg(feature = "dnssec")]
96299605 fn get_pending_dns_onion_messages(&self) -> MutexGuard<'_, Vec<(DNSResolverMessage, MessageSendInstructions)>> {
96309606 self.pending_dns_onion_messages.lock().expect("Mutex is locked by other thread.")
@@ -9759,42 +9735,6 @@ where
97599735 .and_then(|paths| (!paths.is_empty()).then(|| paths).ok_or(()))
97609736 }
97619737
9762- fn enqueue_invoice_request(
9763- &self,
9764- invoice_request: InvoiceRequest,
9765- reply_paths: Vec<BlindedMessagePath>,
9766- ) -> Result<(), Bolt12SemanticError> {
9767- let mut pending_offers_messages = self.pending_offers_messages.lock().unwrap();
9768- if !invoice_request.paths().is_empty() {
9769- reply_paths
9770- .iter()
9771- .flat_map(|reply_path| invoice_request.paths().iter().map(move |path| (path, reply_path)))
9772- .take(OFFERS_MESSAGE_REQUEST_LIMIT)
9773- .for_each(|(path, reply_path)| {
9774- let instructions = MessageSendInstructions::WithSpecifiedReplyPath {
9775- destination: Destination::BlindedPath(path.clone()),
9776- reply_path: reply_path.clone(),
9777- };
9778- let message = OffersMessage::InvoiceRequest(invoice_request.clone());
9779- pending_offers_messages.push((message, instructions));
9780- });
9781- } else if let Some(node_id) = invoice_request.issuer_signing_pubkey() {
9782- for reply_path in reply_paths {
9783- let instructions = MessageSendInstructions::WithSpecifiedReplyPath {
9784- destination: Destination::Node(node_id),
9785- reply_path,
9786- };
9787- let message = OffersMessage::InvoiceRequest(invoice_request.clone());
9788- pending_offers_messages.push((message, instructions));
9789- }
9790- } else {
9791- debug_assert!(false);
9792- return Err(Bolt12SemanticError::MissingIssuerSigningPubkey);
9793- }
9794-
9795- Ok(())
9796- }
9797-
97989738 fn get_current_blocktime(&self) -> Duration {
97999739 Duration::from_secs(self.highest_seen_timestamp.load(Ordering::Acquire) as u64)
98009740 }
@@ -9832,13 +9772,6 @@ where
98329772 }
98339773}
98349774
9835- /// Defines the maximum number of [`OffersMessage`] including different reply paths to be sent
9836- /// along different paths.
9837- /// Sending multiple requests increases the chances of successful delivery in case some
9838- /// paths are unavailable. However, only one invoice for a given [`PaymentId`] will be paid,
9839- /// even if multiple invoices are received.
9840- pub const OFFERS_MESSAGE_REQUEST_LIMIT: usize = 10;
9841-
98429775impl<M: Deref, T: Deref, ES: Deref, NS: Deref, SP: Deref, F: Deref, R: Deref, MR: Deref, L: Deref> ChannelManager<M, T, ES, NS, SP, F, R, MR, L>
98439776where
98449777 M::Target: chain::Watch<<SP::Target as SignerProvider>::EcdsaSigner>,
@@ -13174,7 +13107,6 @@ where
1317413107
1317513108 funding_batch_states: Mutex::new(BTreeMap::new()),
1317613109
13177- pending_offers_messages: Mutex::new(Vec::new()),
1317813110 pending_async_payments_messages: Mutex::new(Vec::new()),
1317913111
1318013112 pending_broadcast_messages: Mutex::new(Vec::new()),
0 commit comments