Skip to content

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

@Sjors

Description

@Sjors

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions