Include on-chain payments in list payments API#219
Conversation
|
👋 Thanks for assigning @tnull as a reviewer! |
ListPayments only read from ldk-server's paginated payment store, which is populated from Lightning payment events. On-chain payments are stored by LDK Node directly, so they never appeared in paginated list responses. Backfill on-chain payments from LDK Node before reading the existing paginated store. This keeps list payments complete until LDK Node owns paginated listing for both Lightning and on-chain payments. Add an e2e test covering an on-chain send appearing in list payments.
ad05e31 to
4889d15
Compare
| // TODO: Delete this temporary bridge when on-chain and Lightning payments are served from the | ||
| // same paginated LDK Node source. | ||
| fn sync_onchain_payments_to_paginated_store(context: &Context) -> Result<(), LdkServerError> { | ||
| for payment_details in context.node.list_payments().into_iter().filter(is_onchain_payment) { |
There was a problem hiding this comment.
theres a list_payments_with_filter api already available btw
| for payment_details in context.node.list_payments().into_iter().filter(is_onchain_payment) { | |
| for payment_details in context.node.list_payments_with_filter(|p| matches!(p.kind, PaymentKind::Onchain { .. })) |
tnull
left a comment
There was a problem hiding this comment.
Hmm, I'm confused why we need this, isn't the plan to enable pagination on LDK Node's payment store and to drop the separate paginated store in Server entirely?
Yeah this is a temporary fix
|
ListPayments only read from ldk-server's paginated payment store, which is populated from Lightning payment events. On-chain payments are stored by LDK Node directly, so they never appeared in paginated list responses.
Backfill on-chain payments from LDK Node before reading the existing paginated store. This keeps list payments complete until LDK Node owns paginated listing for both Lightning and on-chain payments. Eventually we can remove this when we use the paginated KV store all throughout ldk-node.
Add an e2e test covering an on-chain send appearing in list payments.