@@ -35,7 +35,6 @@ use bitcoin::{secp256k1, Sequence, Weight};
35
35
use crate::events::FundingInfo;
36
36
use crate::blinded_path::message::{AsyncPaymentsContext, MessageForwardNode};
37
37
use crate::blinded_path::NodeIdLookUp;
38
- use crate::blinded_path::message::BlindedMessagePath;
39
38
use crate::blinded_path::payment::{BlindedPaymentPath, PaymentConstraints, PaymentContext, UnauthenticatedReceiveTlvs};
40
39
use crate::chain;
41
40
use crate::chain::{Confirm, ChannelMonitorUpdateStatus, Watch, BestBlock};
@@ -67,13 +66,10 @@ use crate::ln::outbound_payment;
67
66
use crate::ln::outbound_payment::{OutboundPayments, PendingOutboundPayment, RetryableInvoiceRequest, SendAlongPathArgs, StaleExpiration};
68
67
use crate::offers::invoice::Bolt12Invoice;
69
68
use crate::offers::invoice::UnsignedBolt12Invoice;
70
- use crate::offers::invoice_request::InvoiceRequest;
71
69
use crate::offers::nonce::Nonce;
72
- use crate::offers::parse::Bolt12SemanticError;
73
70
use crate::offers::signer;
74
71
use crate::onion_message::async_payments::{AsyncPaymentsMessage, HeldHtlcAvailable, ReleaseHeldHtlc, AsyncPaymentsMessageHandler};
75
- use crate::onion_message::messenger::{DefaultMessageRouter, Destination, MessageRouter, MessageSendInstructions, Responder, ResponseInstruction};
76
- use crate::onion_message::offers::OffersMessage;
72
+ use crate::onion_message::messenger::{MessageRouter, MessageSendInstructions, Responder, ResponseInstruction};
77
73
use crate::sign::{EntropySource, NodeSigner, Recipient, SignerProvider};
78
74
use crate::sign::ecdsa::EcdsaChannelSigner;
79
75
use crate::util::config::{UserConfig, ChannelConfig, ChannelConfigUpdate};
@@ -84,14 +80,20 @@ use crate::util::ser::{BigSize, FixedLengthReader, Readable, ReadableArgs, Maybe
84
80
use crate::util::ser::TransactionU16LenLimited;
85
81
use crate::util::logger::{Level, Logger, WithContext};
86
82
use crate::util::errors::APIError;
87
- #[cfg(async_payments)]
88
- use crate::offers::static_invoice::StaticInvoice;
89
83
90
84
#[cfg(feature = "dnssec")]
91
85
use crate::onion_message::dns_resolution::{DNSResolverMessage, OMNameResolver};
92
86
87
+ #[cfg(async_payments)]
88
+ use {
89
+ crate::blinded_path::message::{BlindedMessagePath, MessageContext},
90
+ crate::offers::static_invoice::StaticInvoice,
91
+ crate::onion_message::messenger::Destination,
92
+ };
93
+
93
94
#[cfg(not(c_bindings))]
94
95
use {
96
+ crate::onion_message::messenger::DefaultMessageRouter,
95
97
crate::routing::router::DefaultRouter,
96
98
crate::routing::gossip::NetworkGraph,
97
99
crate::routing::scoring::{ProbabilisticScorer, ProbabilisticScoringFeeParameters},
@@ -2169,8 +2171,6 @@ where
2169
2171
//
2170
2172
// Lock order tree:
2171
2173
//
2172
- // `pending_offers_messages`
2173
- //
2174
2174
// `pending_async_payments_messages`
2175
2175
//
2176
2176
// `total_consistency_lock`
@@ -2418,10 +2418,6 @@ where
2418
2418
event_persist_notifier: Notifier,
2419
2419
needs_persist_flag: AtomicBool,
2420
2420
2421
- #[cfg(not(any(test, feature = "_test_utils")))]
2422
- pending_offers_messages: Mutex<Vec<(OffersMessage, MessageSendInstructions)>>,
2423
- #[cfg(any(test, feature = "_test_utils"))]
2424
- pub(crate) pending_offers_messages: Mutex<Vec<(OffersMessage, MessageSendInstructions)>>,
2425
2421
pending_async_payments_messages: Mutex<Vec<(AsyncPaymentsMessage, MessageSendInstructions)>>,
2426
2422
2427
2423
/// Tracks the message events that are to be broadcasted when we are connected to some peer.
@@ -3345,7 +3341,6 @@ where
3345
3341
needs_persist_flag: AtomicBool::new(false),
3346
3342
funding_batch_states: Mutex::new(BTreeMap::new()),
3347
3343
3348
- pending_offers_messages: Mutex::new(Vec::new()),
3349
3344
pending_async_payments_messages: Mutex::new(Vec::new()),
3350
3345
pending_broadcast_messages: Mutex::new(Vec::new()),
3351
3346
@@ -9474,10 +9469,6 @@ where
9474
9469
MR::Target: MessageRouter,
9475
9470
L::Target: Logger,
9476
9471
{
9477
- fn get_pending_offers_messages(&self) -> MutexGuard<'_, Vec<(OffersMessage, MessageSendInstructions)>> {
9478
- self.pending_offers_messages.lock().expect("Mutex is locked by other thread.")
9479
- }
9480
-
9481
9472
#[cfg(feature = "dnssec")]
9482
9473
fn get_pending_dns_onion_messages(&self) -> MutexGuard<'_, Vec<(DNSResolverMessage, MessageSendInstructions)>> {
9483
9474
self.pending_dns_onion_messages.lock().expect("Mutex is locked by other thread.")
@@ -9534,10 +9525,6 @@ where
9534
9525
self.pending_outbound_payments.release_invoice_requests_awaiting_invoice()
9535
9526
}
9536
9527
9537
- fn enqueue_invoice_request(&self, invoice_request: InvoiceRequest, reply_paths: Vec<BlindedMessagePath>) -> Result<(), Bolt12SemanticError> {
9538
- self.enqueue_invoice_request(invoice_request, reply_paths)
9539
- }
9540
-
9541
9528
fn get_current_blocktime(&self) -> Duration {
9542
9529
Duration::from_secs(self.highest_seen_timestamp.load(Ordering::Acquire) as u64)
9543
9530
}
@@ -9584,13 +9571,6 @@ where
9584
9571
}
9585
9572
}
9586
9573
9587
- /// Defines the maximum number of [`OffersMessage`] including different reply paths to be sent
9588
- /// along different paths.
9589
- /// Sending multiple requests increases the chances of successful delivery in case some
9590
- /// paths are unavailable. However, only one invoice for a given [`PaymentId`] will be paid,
9591
- /// even if multiple invoices are received.
9592
- pub const OFFERS_MESSAGE_REQUEST_LIMIT: usize = 10;
9593
-
9594
9574
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>
9595
9575
where
9596
9576
M::Target: chain::Watch<<SP::Target as SignerProvider>::EcdsaSigner>,
@@ -9603,41 +9583,6 @@ where
9603
9583
MR::Target: MessageRouter,
9604
9584
L::Target: Logger,
9605
9585
{
9606
- fn enqueue_invoice_request(
9607
- &self,
9608
- invoice_request: InvoiceRequest,
9609
- reply_paths: Vec<BlindedMessagePath>,
9610
- ) -> Result<(), Bolt12SemanticError> {
9611
- let mut pending_offers_messages = self.pending_offers_messages.lock().unwrap();
9612
- if !invoice_request.paths().is_empty() {
9613
- reply_paths
9614
- .iter()
9615
- .flat_map(|reply_path| invoice_request.paths().iter().map(move |path| (path, reply_path)))
9616
- .take(OFFERS_MESSAGE_REQUEST_LIMIT)
9617
- .for_each(|(path, reply_path)| {
9618
- let instructions = MessageSendInstructions::WithSpecifiedReplyPath {
9619
- destination: Destination::BlindedPath(path.clone()),
9620
- reply_path: reply_path.clone(),
9621
- };
9622
- let message = OffersMessage::InvoiceRequest(invoice_request.clone());
9623
- pending_offers_messages.push((message, instructions));
9624
- });
9625
- } else if let Some(node_id) = invoice_request.issuer_signing_pubkey() {
9626
- for reply_path in reply_paths {
9627
- let instructions = MessageSendInstructions::WithSpecifiedReplyPath {
9628
- destination: Destination::Node(node_id),
9629
- reply_path,
9630
- };
9631
- let message = OffersMessage::InvoiceRequest(invoice_request.clone());
9632
- pending_offers_messages.push((message, instructions));
9633
- }
9634
- } else {
9635
- debug_assert!(false);
9636
- return Err(Bolt12SemanticError::MissingIssuerSigningPubkey);
9637
- }
9638
- Ok(())
9639
- }
9640
-
9641
9586
#[cfg(async_payments)]
9642
9587
pub(super) fn duration_since_epoch(&self) -> Duration {
9643
9588
#[cfg(not(feature = "std"))]
@@ -13158,7 +13103,6 @@ where
13158
13103
13159
13104
funding_batch_states: Mutex::new(BTreeMap::new()),
13160
13105
13161
- pending_offers_messages: Mutex::new(Vec::new()),
13162
13106
pending_async_payments_messages: Mutex::new(Vec::new()),
13163
13107
13164
13108
pending_broadcast_messages: Mutex::new(Vec::new()),
0 commit comments