When fetching invoices and other records like forwards via the RPC, those record sets are separated into pages to allow for scalable retrieval of data.
With ListPayments all of the payments are returned in a single response. If a node is doing regular payments or the incomplete payments flag is used, the number of results from this request can be very large.
In PR https://github.com/lightningnetwork/lnd/pull/1962 it was suggested that the fix should be to add pagination.
I will try to do this :+1:
Update: still working on it, almost finished
Closed by #3960. Note that there'll be a future follow up to make the implementation more efficient in the future as well.
Most helpful comment
I will try to do this :+1:
Update: still working on it, almost finished