@@ -66,15 +66,12 @@ use crate::ln::outbound_payment::{OutboundPayments, PendingOutboundPayment, Retr
66
66
use crate::ln::wire::Encode;
67
67
use crate::offers::invoice::Bolt12Invoice;
68
68
use crate::offers::invoice::UnsignedBolt12Invoice;
69
- use crate::offers::invoice_request::InvoiceRequest;
70
69
use crate::offers::nonce::Nonce;
71
- use crate::offers::parse::Bolt12SemanticError;
72
70
use crate::offers::signer;
73
71
#[cfg(async_payments)]
74
72
use crate::offers::static_invoice::StaticInvoice;
75
73
use crate::onion_message::async_payments::{AsyncPaymentsMessage, HeldHtlcAvailable, ReleaseHeldHtlc, AsyncPaymentsMessageHandler};
76
- use crate::onion_message::messenger::{DefaultMessageRouter, Destination, MessageRouter, MessageSendInstructions, Responder, ResponseInstruction};
77
- use crate::onion_message::offers::OffersMessage;
74
+ use crate::onion_message::messenger::{DefaultMessageRouter, MessageRouter, MessageSendInstructions, Responder, ResponseInstruction};
78
75
use crate::sign::{EntropySource, NodeSigner, Recipient, SignerProvider};
79
76
use crate::sign::ecdsa::EcdsaChannelSigner;
80
77
use crate::util::config::{UserConfig, ChannelConfig, ChannelConfigUpdate};
@@ -2106,8 +2103,6 @@ where
2106
2103
//
2107
2104
// Lock order tree:
2108
2105
//
2109
- // `pending_offers_messages`
2110
- //
2111
2106
// `pending_async_payments_messages`
2112
2107
//
2113
2108
// `total_consistency_lock`
@@ -2356,10 +2351,6 @@ where
2356
2351
event_persist_notifier: Notifier,
2357
2352
needs_persist_flag: AtomicBool,
2358
2353
2359
- #[cfg(not(any(test, feature = "_test_utils")))]
2360
- pending_offers_messages: Mutex<Vec<(OffersMessage, MessageSendInstructions)>>,
2361
- #[cfg(any(test, feature = "_test_utils"))]
2362
- pub(crate) pending_offers_messages: Mutex<Vec<(OffersMessage, MessageSendInstructions)>>,
2363
2354
pending_async_payments_messages: Mutex<Vec<(AsyncPaymentsMessage, MessageSendInstructions)>>,
2364
2355
2365
2356
/// Tracks the message events that are to be broadcasted when we are connected to some peer.
@@ -3218,7 +3209,6 @@ where
3218
3209
needs_persist_flag: AtomicBool::new(false),
3219
3210
funding_batch_states: Mutex::new(BTreeMap::new()),
3220
3211
3221
- pending_offers_messages: Mutex::new(Vec::new()),
3222
3212
pending_async_payments_messages: Mutex::new(Vec::new()),
3223
3213
pending_broadcast_messages: Mutex::new(Vec::new()),
3224
3214
@@ -9164,9 +9154,6 @@ impl Default for Bolt11InvoiceParameters {
9164
9154
///
9165
9155
/// [`OffersMessageFlow`]: crate::offers::flow::OffersMessageFlow
9166
9156
pub trait OffersMessageCommons {
9167
- /// Get pending offers messages
9168
- fn get_pending_offers_messages(&self) -> MutexGuard<'_, Vec<(OffersMessage, MessageSendInstructions)>>;
9169
-
9170
9157
#[cfg(feature = "dnssec")]
9171
9158
/// Get pending DNS onion messages
9172
9159
fn get_pending_dns_onion_messages(&self) -> MutexGuard<'_, Vec<(DNSResolverMessage, MessageSendInstructions)>>;
@@ -9264,13 +9251,6 @@ pub trait OffersMessageCommons {
9264
9251
/// Errors if the `MessageRouter` errors.
9265
9252
fn create_blinded_paths(&self, context: MessageContext) -> Result<Vec<BlindedMessagePath>, ()>;
9266
9253
9267
- /// Enqueue invoice request
9268
- fn enqueue_invoice_request(
9269
- &self,
9270
- invoice_request: InvoiceRequest,
9271
- reply_paths: Vec<BlindedMessagePath>,
9272
- ) -> Result<(), Bolt12SemanticError>;
9273
-
9274
9254
/// Get the current time determined by highest seen timestamp
9275
9255
fn get_current_blocktime(&self) -> Duration;
9276
9256
@@ -9310,10 +9290,6 @@ where
9310
9290
MR::Target: MessageRouter,
9311
9291
L::Target: Logger,
9312
9292
{
9313
- fn get_pending_offers_messages(&self) -> MutexGuard<'_, Vec<(OffersMessage, MessageSendInstructions)>> {
9314
- self.pending_offers_messages.lock().expect("Mutex is locked by other thread.")
9315
- }
9316
-
9317
9293
#[cfg(feature = "dnssec")]
9318
9294
fn get_pending_dns_onion_messages(&self) -> MutexGuard<'_, Vec<(DNSResolverMessage, MessageSendInstructions)>> {
9319
9295
self.pending_dns_onion_messages.lock().expect("Mutex is locked by other thread.")
@@ -9448,42 +9424,6 @@ where
9448
9424
.and_then(|paths| (!paths.is_empty()).then(|| paths).ok_or(()))
9449
9425
}
9450
9426
9451
- fn enqueue_invoice_request(
9452
- &self,
9453
- invoice_request: InvoiceRequest,
9454
- reply_paths: Vec<BlindedMessagePath>,
9455
- ) -> Result<(), Bolt12SemanticError> {
9456
- let mut pending_offers_messages = self.pending_offers_messages.lock().unwrap();
9457
- if !invoice_request.paths().is_empty() {
9458
- reply_paths
9459
- .iter()
9460
- .flat_map(|reply_path| invoice_request.paths().iter().map(move |path| (path, reply_path)))
9461
- .take(OFFERS_MESSAGE_REQUEST_LIMIT)
9462
- .for_each(|(path, reply_path)| {
9463
- let instructions = MessageSendInstructions::WithSpecifiedReplyPath {
9464
- destination: Destination::BlindedPath(path.clone()),
9465
- reply_path: reply_path.clone(),
9466
- };
9467
- let message = OffersMessage::InvoiceRequest(invoice_request.clone());
9468
- pending_offers_messages.push((message, instructions));
9469
- });
9470
- } else if let Some(node_id) = invoice_request.issuer_signing_pubkey() {
9471
- for reply_path in reply_paths {
9472
- let instructions = MessageSendInstructions::WithSpecifiedReplyPath {
9473
- destination: Destination::Node(node_id),
9474
- reply_path,
9475
- };
9476
- let message = OffersMessage::InvoiceRequest(invoice_request.clone());
9477
- pending_offers_messages.push((message, instructions));
9478
- }
9479
- } else {
9480
- debug_assert!(false);
9481
- return Err(Bolt12SemanticError::MissingIssuerSigningPubkey);
9482
- }
9483
-
9484
- Ok(())
9485
- }
9486
-
9487
9427
fn get_current_blocktime(&self) -> Duration {
9488
9428
Duration::from_secs(self.highest_seen_timestamp.load(Ordering::Acquire) as u64)
9489
9429
}
@@ -9521,13 +9461,6 @@ where
9521
9461
}
9522
9462
}
9523
9463
9524
- /// Defines the maximum number of [`OffersMessage`] including different reply paths to be sent
9525
- /// along different paths.
9526
- /// Sending multiple requests increases the chances of successful delivery in case some
9527
- /// paths are unavailable. However, only one invoice for a given [`PaymentId`] will be paid,
9528
- /// even if multiple invoices are received.
9529
- pub const OFFERS_MESSAGE_REQUEST_LIMIT: usize = 10;
9530
-
9531
9464
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>
9532
9465
where
9533
9466
M::Target: chain::Watch<<SP::Target as SignerProvider>::EcdsaSigner>,
@@ -12844,7 +12777,6 @@ where
12844
12777
12845
12778
funding_batch_states: Mutex::new(BTreeMap::new()),
12846
12779
12847
- pending_offers_messages: Mutex::new(Vec::new()),
12848
12780
pending_async_payments_messages: Mutex::new(Vec::new()),
12849
12781
12850
12782
pending_broadcast_messages: Mutex::new(Vec::new()),
0 commit comments