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

[Feature] listpays, listinvoices: display most recent N #6338

Closed
Sjors opened this issue Jun 15, 2023 · 2 comments · May be fixed by #7385
Closed

[Feature] listpays, listinvoices: display most recent N #6338

Sjors opened this issue Jun 15, 2023 · 2 comments · May be fixed by #7385

Comments

@Sjors
Copy link
Contributor

Sjors commented Jun 15, 2023

The output for listpays is rather large for me. I'm usually only interested in the last one or two, namely to check:

  1. if a payment is stuck or failed (so I know if it's safe to try again)
  2. if I accidentally paid twice for my Club Mate

My current workaround is to just do lightning-cli listpays | tail -n 200, but I'd rather be able to do something like listpays -2 (or just 2, assuming most of the time you want the most recent thing).

Another workaround is to pass the full result into JQ and get the last element(s).

Same story for listinvoices; those 10K+ keysends crash my SSH connection if I forget to pipe tail.

I suspect clients like c-lightning-REST would also benefit from the ability to fetch only recent transactions, so mobile apps like Zeus can be more responsive. For that use case you probably want an offset argument too.

@Sjors Sjors changed the title [Feature] listpays: display most recent N [Feature] listpays, listinvoices: display most recent N Jun 15, 2023
@vincenzopalazzo
Copy link
Collaborator

There is @rustyrussell who it is working on a paginator-like API, but I agree we should fix in some way this problem.

I had also a paginator API with implemented somewhere, so someday we will be able to solve this problem for sure :)

@cdecker
Copy link
Member

cdecker commented Jun 19, 2023

Since this has been requested a number of times before I opened #6348 to track progress, and collect discussions around this feature. Marking this as duplicate so we don't distribute the discussion across many topics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants