]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Store AsyncPaymentsMessages for later sending
authorValentine Wallace <vwallace@protonmail.com>
Thu, 13 Jun 2024 15:25:20 +0000 (11:25 -0400)
committerValentine Wallace <vwallace@protonmail.com>
Thu, 12 Sep 2024 15:16:03 +0000 (11:16 -0400)
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.

lightning/src/ln/channelmanager.rs

index f21a0a20be596f7accb3d2947db63ee8d9496b51..730332d2ec08ef1858627a56e30c92eedd8bfe42 100644 (file)
@@ -2060,6 +2060,8 @@ where
 //
 // `pending_offers_messages`
 //
+// `pending_async_payments_messages`
+//
 // `total_consistency_lock`
 //  |
 //  |__`forward_htlcs`
@@ -2315,6 +2317,7 @@ where
        pending_offers_messages: Mutex<Vec<(OffersMessage, MessageSendInstructions)>>,
        #[cfg(any(test, feature = "_test_utils"))]
        pub(crate) pending_offers_messages: Mutex<Vec<(OffersMessage, MessageSendInstructions)>>,
+       pending_async_payments_messages: Mutex<Vec<(AsyncPaymentsMessage, MessageSendInstructions)>>,
 
        /// Tracks the message events that are to be broadcasted when we are connected to some peer.
        pending_broadcast_messages: Mutex<Vec<MessageSendEvent>>,
@@ -3135,6 +3138,7 @@ where
                        funding_batch_states: Mutex::new(BTreeMap::new()),
 
                        pending_offers_messages: Mutex::new(Vec::new()),
+                       pending_async_payments_messages: Mutex::new(Vec::new()),
                        pending_broadcast_messages: Mutex::new(Vec::new()),
 
                        last_days_feerates: Mutex::new(VecDeque::new()),
@@ -12827,6 +12831,7 @@ where
                        funding_batch_states: Mutex::new(BTreeMap::new()),
 
                        pending_offers_messages: Mutex::new(Vec::new()),
+                       pending_async_payments_messages: Mutex::new(Vec::new()),
 
                        pending_broadcast_messages: Mutex::new(Vec::new()),