mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-10-09 23:03:15 +02:00
cli: update listinvoices
and listpayments
to use the date filter
This commit is contained in:
@@ -234,6 +234,18 @@ var listInvoicesCommand = cli.Command{
|
||||
Usage: "if set, invoices succeeding the " +
|
||||
"index_offset will be returned",
|
||||
},
|
||||
cli.Uint64Flag{
|
||||
Name: "creation_date_start",
|
||||
Usage: "timestamp in seconds, if set, filter " +
|
||||
"invoices with creation date greater than or " +
|
||||
"equal to it",
|
||||
},
|
||||
cli.Uint64Flag{
|
||||
Name: "creation_date_end",
|
||||
Usage: "timestamp in seconds, if set, filter " +
|
||||
"invoices with creation date less than or " +
|
||||
"equal to it",
|
||||
},
|
||||
},
|
||||
Action: actionDecorator(listInvoices),
|
||||
}
|
||||
@@ -244,10 +256,12 @@ func listInvoices(ctx *cli.Context) error {
|
||||
defer cleanUp()
|
||||
|
||||
req := &lnrpc.ListInvoiceRequest{
|
||||
PendingOnly: ctx.Bool("pending_only"),
|
||||
IndexOffset: ctx.Uint64("index_offset"),
|
||||
NumMaxInvoices: ctx.Uint64("max_invoices"),
|
||||
Reversed: !ctx.Bool("paginate-forwards"),
|
||||
PendingOnly: ctx.Bool("pending_only"),
|
||||
IndexOffset: ctx.Uint64("index_offset"),
|
||||
NumMaxInvoices: ctx.Uint64("max_invoices"),
|
||||
Reversed: !ctx.Bool("paginate-forwards"),
|
||||
CreationDateStart: ctx.Uint64("creation_date_start"),
|
||||
CreationDateEnd: ctx.Uint64("creation_date_end"),
|
||||
}
|
||||
|
||||
invoices, err := client.ListInvoices(ctxc, req)
|
||||
|
@@ -1229,6 +1229,18 @@ var listPaymentsCommand = cli.Command{
|
||||
"be counted; can take a long time on systems " +
|
||||
"with many payments",
|
||||
},
|
||||
cli.Uint64Flag{
|
||||
Name: "creation_date_start",
|
||||
Usage: "timestamp in seconds, if set, filter " +
|
||||
"payments with creation date greater than or " +
|
||||
"equal to it",
|
||||
},
|
||||
cli.Uint64Flag{
|
||||
Name: "creation_date_end",
|
||||
Usage: "timestamp in seconds, if set, filter " +
|
||||
"payments with creation date less than or " +
|
||||
"equal to it",
|
||||
},
|
||||
},
|
||||
Action: actionDecorator(listPayments),
|
||||
}
|
||||
@@ -1244,6 +1256,8 @@ func listPayments(ctx *cli.Context) error {
|
||||
MaxPayments: uint64(ctx.Uint("max_payments")),
|
||||
Reversed: !ctx.Bool("paginate_forwards"),
|
||||
CountTotalPayments: ctx.Bool("count_total_payments"),
|
||||
CreationDateStart: ctx.Uint64("creation_date_start"),
|
||||
CreationDateEnd: ctx.Uint64("creation_date_end"),
|
||||
}
|
||||
|
||||
payments, err := client.ListPayments(ctxc, req)
|
||||
|
Reference in New Issue
Block a user