lnd
lnd copied to clipboard
Invoice filtering by creation date
Fixes #6533
Add fields min_creation_date
and max_creation_date
to ListInvoiceRequest
proto and add underlying support for them in the rpc server.
Worth noting, the implementation filters in linear time with respect to the total number of invoices. I looked into using the addIndexBucket
to do a binary search by invoice id, and from what I can tell it looks like we can guarantee that the invoice indices will be in the same order as the invoice creation times, but I'm not 100% confident about this. Can someone confirm whether or not this is an invariant we can rely on for binary searching the upper/lower creation time bounds?
The sequence num is always increasing but it doesn't guarantee to have the same order as the creation time.
Gotcha. Then I think a good plan for now is to perform this operation in linear time, and look into doing a binary search once we're fully migrated to SQL.
@tvolk131, remember to re-request review from reviewers when ready
!lightninglabs-deploy mute 2022-Nov-01
@tvolk131, remember to re-request review from reviewers when ready
Replaced by #7159