Skip to content

Commit 7d50a2d

Browse files
Store AsyncPaymentsMessages for later sending
Upcoming commits will support sending and receiving held_htlc_available and release_held_htlc messages. These messages need to be enqueued so that they can be released in ChannelManager's implementation of AsyncPaymentsMessageHandler to OnionMessenger for sending.
1 parent 5f932d1 commit 7d50a2d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ use crate::offers::invoice_request::{DerivedPayerId, InvoiceRequestBuilder};
6666
use crate::offers::offer::{Offer, OfferBuilder};
6767
use crate::offers::parse::Bolt12SemanticError;
6868
use crate::offers::refund::{Refund, RefundBuilder};
69+
use crate::onion_message::async_payments::AsyncPaymentsMessage;
6970
use crate::onion_message::messenger::{new_pending_onion_message, Destination, MessageRouter, PendingOnionMessage, Responder, ResponseInstruction};
7071
use crate::onion_message::offers::{OffersMessage, OffersMessageHandler};
7172
use crate::sign::{EntropySource, NodeSigner, Recipient, SignerProvider};
@@ -1847,6 +1848,8 @@ where
18471848
//
18481849
// `pending_offers_messages`
18491850
//
1851+
// `pending_async_payments_messages`
1852+
//
18501853
// `total_consistency_lock`
18511854
// |
18521855
// |__`forward_htlcs`
@@ -2099,6 +2102,7 @@ where
20992102
needs_persist_flag: AtomicBool,
21002103

21012104
pending_offers_messages: Mutex<Vec<PendingOnionMessage<OffersMessage>>>,
2105+
pending_async_payments_messages: Mutex<Vec<PendingOnionMessage<AsyncPaymentsMessage>>>,
21022106

21032107
/// Tracks the message events that are to be broadcasted when we are connected to some peer.
21042108
pending_broadcast_messages: Mutex<Vec<MessageSendEvent>>,
@@ -2893,6 +2897,7 @@ where
28932897
funding_batch_states: Mutex::new(BTreeMap::new()),
28942898

28952899
pending_offers_messages: Mutex::new(Vec::new()),
2900+
pending_async_payments_messages: Mutex::new(Vec::new()),
28962901
pending_broadcast_messages: Mutex::new(Vec::new()),
28972902

28982903
last_days_feerates: Mutex::new(VecDeque::new()),
@@ -12123,6 +12128,7 @@ where
1212312128
funding_batch_states: Mutex::new(BTreeMap::new()),
1212412129

1212512130
pending_offers_messages: Mutex::new(Vec::new()),
12131+
pending_async_payments_messages: Mutex::new(Vec::new()),
1212612132

1212712133
pending_broadcast_messages: Mutex::new(Vec::new()),
1212812134

0 commit comments

Comments
 (0)