Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support paying static invoices #3140

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
732ee14
Tweak debug_assert message for parsed onion messages.
valentinewallace Jul 12, 2024
a3216ac
Add MessageContext for async payments.
valentinewallace Jul 10, 2024
e162278
Pass context into held_htlc_available message handling.
valentinewallace Jul 10, 2024
3d5d64a
Store AsyncPaymentsMessages for later sending
valentinewallace Jun 13, 2024
cff6e34
Support checking that a static invoice matches an outbound invreq.
valentinewallace Jun 13, 2024
ad63a70
Support creating PaymentParameters from static invoices.
valentinewallace Jun 13, 2024
c3ed4a2
Store async payment data in PendingOutboundPayment.
valentinewallace Jul 10, 2024
7fb16ea
Pass full message context into ChanMan blinded path util.
valentinewallace Jul 10, 2024
c976e4c
Release pending async payments to PeerManager.
valentinewallace Aug 29, 2024
b6f4479
Support initiating an async payment to a static invoice.
valentinewallace Aug 29, 2024
28269a7
DRY handling when initiating payment to BOLT 12 invoice.
valentinewallace Aug 29, 2024
e4d7681
Error on static invoice with unknown required features.
valentinewallace Aug 29, 2024
8569830
Set max path len on receipt of static invoice.
valentinewallace Aug 29, 2024
69356e7
Split off send_payment_for_bolt12_invoice_internal util.
valentinewallace Sep 4, 2024
0297a1e
Support sending async payments as an always-online sender.
valentinewallace Sep 4, 2024
985e6ac
Timeout expired outbound async payments.
valentinewallace Jun 20, 2024
6d415b1
Support abandoning pending outbound async payments.
valentinewallace Jun 20, 2024
7dd1787
Correct docs on payment id in RecentPaymentDetails.
valentinewallace Aug 20, 2024
c4f3e25
Don't trigger manager persistence on unexpected release_htlc message.
valentinewallace Aug 29, 2024
5a7f523
Rename Payment{Hash,Id} hmac creation/verification methods for offers.
valentinewallace Sep 5, 2024
615eefb
Verify inbound ReleaseHeldHtlc messages via hmac.
valentinewallace Sep 5, 2024
26d1582
Add new Bolt12PaymentError for failed blinded path creation.
valentinewallace Sep 6, 2024
4bcf53e
Document PendingOutboundPayment::{Static}InvoiceReceived semantics.
valentinewallace Sep 10, 2024
6e27aec
Remove payment_release_secret from async payments messages.
valentinewallace Sep 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lightning/src/ln/channelmanager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why isn't this in the commit that adds pending_async_payments_messages?

}
}

Expand Down
8 changes: 8 additions & 0 deletions lightning/src/onion_message/messenger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down