]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Release pending async payments to PeerManager.
authorValentine Wallace <vwallace@protonmail.com>
Thu, 29 Aug 2024 18:25:40 +0000 (14:25 -0400)
committerValentine Wallace <vwallace@protonmail.com>
Fri, 13 Sep 2024 14:40:05 +0000 (10:40 -0400)
lightning/src/ln/channelmanager.rs
lightning/src/onion_message/messenger.rs

index c6cffaf1023ac15f54bb8e6691d417e0d64d2d39..8120fb4017ca5ea662b733fd55aeb9f65953fbaa 100644 (file)
@@ -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())
        }
 }
 
index 6883b02c145730eb3f2bc97ecfd734da6c84d4c2..ab7ccbdab38609a06f6c06e0b2ead7500e0e9d2c 100644 (file)
@@ -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(