From c976e4cd1481c069ffc4b5497e3b54c6511fd1df Mon Sep 17 00:00:00 2001 From: Valentine Wallace Date: Thu, 29 Aug 2024 14:25:40 -0400 Subject: [PATCH] Release pending async payments to PeerManager. --- lightning/src/ln/channelmanager.rs | 2 +- lightning/src/onion_message/messenger.rs | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lightning/src/ln/channelmanager.rs b/lightning/src/ln/channelmanager.rs index c6cffaf10..8120fb401 100644 --- a/lightning/src/ln/channelmanager.rs +++ b/lightning/src/ln/channelmanager.rs @@ -11106,7 +11106,7 @@ where fn release_held_htlc(&self, _message: ReleaseHeldHtlc, _context: AsyncPaymentsContext) {} fn release_pending_messages(&self) -> Vec<(AsyncPaymentsMessage, MessageSendInstructions)> { - Vec::new() + core::mem::take(&mut self.pending_async_payments_messages.lock().unwrap()) } } diff --git a/lightning/src/onion_message/messenger.rs b/lightning/src/onion_message/messenger.rs index 6883b02c1..ab7ccbdab 100644 --- a/lightning/src/onion_message/messenger.rs +++ b/lightning/src/onion_message/messenger.rs @@ -1765,6 +1765,14 @@ where ); } + #[cfg(async_payments)] { + for (message, instructions) in self.async_payments_handler.release_pending_messages() { + let _ = self.send_onion_message_internal( + message, instructions, format_args!("when sending AsyncPaymentsMessage") + ); + } + } + // Enqueue any initiating `CustomMessage`s to send. for (message, instructions) in self.custom_handler.release_pending_custom_messages() { let _ = self.send_onion_message_internal( -- 2.39.5