From: Valentine Wallace Date: Thu, 29 Aug 2024 18:25:40 +0000 (-0400) Subject: Release pending async payments to PeerManager. X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=c976e4cd1481c069ffc4b5497e3b54c6511fd1df;p=rust-lightning Release pending async payments to PeerManager. --- 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(