Skip to content

Commit c976e4c

Browse files
Release pending async payments to PeerManager.
1 parent 7fb16ea commit c976e4c

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11106,7 +11106,7 @@ where
1110611106
fn release_held_htlc(&self, _message: ReleaseHeldHtlc, _context: AsyncPaymentsContext) {}
1110711107

1110811108
fn release_pending_messages(&self) -> Vec<(AsyncPaymentsMessage, MessageSendInstructions)> {
11109-
Vec::new()
11109+
core::mem::take(&mut self.pending_async_payments_messages.lock().unwrap())
1111011110
}
1111111111
}
1111211112

lightning/src/onion_message/messenger.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1765,6 +1765,14 @@ where
17651765
);
17661766
}
17671767

1768+
#[cfg(async_payments)] {
1769+
for (message, instructions) in self.async_payments_handler.release_pending_messages() {
1770+
let _ = self.send_onion_message_internal(
1771+
message, instructions, format_args!("when sending AsyncPaymentsMessage")
1772+
);
1773+
}
1774+
}
1775+
17681776
// Enqueue any initiating `CustomMessage`s to send.
17691777
for (message, instructions) in self.custom_handler.release_pending_custom_messages() {
17701778
let _ = self.send_onion_message_internal(

0 commit comments

Comments
 (0)