lnd icon indicating copy to clipboard operation
lnd copied to clipboard

Invoice filtering by creation date

Open tvolk131 opened this issue 2 years ago • 3 comments

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?

tvolk131 avatar May 15 '22 01:05 tvolk131

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 avatar Jun 19 '22 18:06 tvolk131

@tvolk131, remember to re-request review from reviewers when ready

lightninglabs-deploy avatar Sep 13 '22 14:09 lightninglabs-deploy

!lightninglabs-deploy mute 2022-Nov-01

yyforyongyu avatar Oct 11 '22 16:10 yyforyongyu

@tvolk131, remember to re-request review from reviewers when ready

lightninglabs-deploy avatar Nov 15 '22 01:11 lightninglabs-deploy

Replaced by #7159

yyforyongyu avatar Nov 15 '22 18:11 yyforyongyu