@@ -64,15 +64,12 @@ use crate::ln::outbound_payment;
64
64
use crate::ln::outbound_payment::{OutboundPayments, PendingOutboundPayment, RetryableInvoiceRequest, SendAlongPathArgs, StaleExpiration};
65
65
use crate::offers::invoice::Bolt12Invoice;
66
66
use crate::offers::invoice::UnsignedBolt12Invoice;
67
- use crate::offers::invoice_request::InvoiceRequest;
68
67
use crate::offers::nonce::Nonce;
69
- use crate::offers::parse::Bolt12SemanticError;
70
68
use crate::offers::signer;
71
69
#[cfg(async_payments)]
72
70
use crate::offers::static_invoice::StaticInvoice;
73
71
use 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};
76
73
use crate::sign::{EntropySource, NodeSigner, Recipient, SignerProvider};
77
74
use crate::sign::ecdsa::EcdsaChannelSigner;
78
75
use crate::util::config::{UserConfig, ChannelConfig, ChannelConfigUpdate};
@@ -2113,8 +2110,6 @@ where
2113
2110
//
2114
2111
// Lock order tree:
2115
2112
//
2116
- // `pending_offers_messages`
2117
- //
2118
2113
// `pending_async_payments_messages`
2119
2114
//
2120
2115
// `total_consistency_lock`
@@ -2363,10 +2358,6 @@ where
2363
2358
event_persist_notifier: Notifier,
2364
2359
needs_persist_flag: AtomicBool,
2365
2360
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)>>,
2370
2361
pending_async_payments_messages: Mutex<Vec<(AsyncPaymentsMessage, MessageSendInstructions)>>,
2371
2362
2372
2363
/// Tracks the message events that are to be broadcasted when we are connected to some peer.
@@ -3229,7 +3220,6 @@ where
3229
3220
needs_persist_flag: AtomicBool::new(false),
3230
3221
funding_batch_states: Mutex::new(BTreeMap::new()),
3231
3222
3232
- pending_offers_messages: Mutex::new(Vec::new()),
3233
3223
pending_async_payments_messages: Mutex::new(Vec::new()),
3234
3224
pending_broadcast_messages: Mutex::new(Vec::new()),
3235
3225
@@ -9475,9 +9465,6 @@ impl Default for Bolt11InvoiceParameters {
9475
9465
///
9476
9466
/// [`OffersMessageFlow`]: crate::offers::flow::OffersMessageFlow
9477
9467
pub trait OffersMessageCommons {
9478
- /// Get pending offers messages
9479
- fn get_pending_offers_messages(&self) -> MutexGuard<'_, Vec<(OffersMessage, MessageSendInstructions)>>;
9480
-
9481
9468
#[cfg(feature = "dnssec")]
9482
9469
/// Get pending DNS onion messages
9483
9470
fn get_pending_dns_onion_messages(&self) -> MutexGuard<'_, Vec<(DNSResolverMessage, MessageSendInstructions)>>;
@@ -9575,13 +9562,6 @@ pub trait OffersMessageCommons {
9575
9562
/// Errors if the `MessageRouter` errors.
9576
9563
fn create_blinded_paths(&self, context: MessageContext) -> Result<Vec<BlindedMessagePath>, ()>;
9577
9564
9578
- /// Enqueue invoice request
9579
- fn enqueue_invoice_request(
9580
- &self,
9581
- invoice_request: InvoiceRequest,
9582
- reply_paths: Vec<BlindedMessagePath>,
9583
- ) -> Result<(), Bolt12SemanticError>;
9584
-
9585
9565
/// Get the current time determined by highest seen timestamp
9586
9566
fn get_current_blocktime(&self) -> Duration;
9587
9567
@@ -9621,10 +9601,6 @@ where
9621
9601
MR::Target: MessageRouter,
9622
9602
L::Target: Logger,
9623
9603
{
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
-
9628
9604
#[cfg(feature = "dnssec")]
9629
9605
fn get_pending_dns_onion_messages(&self) -> MutexGuard<'_, Vec<(DNSResolverMessage, MessageSendInstructions)>> {
9630
9606
self.pending_dns_onion_messages.lock().expect("Mutex is locked by other thread.")
@@ -9759,42 +9735,6 @@ where
9759
9735
.and_then(|paths| (!paths.is_empty()).then(|| paths).ok_or(()))
9760
9736
}
9761
9737
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
-
9798
9738
fn get_current_blocktime(&self) -> Duration {
9799
9739
Duration::from_secs(self.highest_seen_timestamp.load(Ordering::Acquire) as u64)
9800
9740
}
@@ -9832,13 +9772,6 @@ where
9832
9772
}
9833
9773
}
9834
9774
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
-
9842
9775
impl<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>
9843
9776
where
9844
9777
M::Target: chain::Watch<<SP::Target as SignerProvider>::EcdsaSigner>,
@@ -13174,7 +13107,6 @@ where
13174
13107
13175
13108
funding_batch_states: Mutex::new(BTreeMap::new()),
13176
13109
13177
- pending_offers_messages: Mutex::new(Vec::new()),
13178
13110
pending_async_payments_messages: Mutex::new(Vec::new()),
13179
13111
13180
13112
pending_broadcast_messages: Mutex::new(Vec::new()),
0 commit comments