mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-10-10 23:32:39 +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 " +
|
Usage: "if set, invoices succeeding the " +
|
||||||
"index_offset will be returned",
|
"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),
|
Action: actionDecorator(listInvoices),
|
||||||
}
|
}
|
||||||
@@ -248,6 +260,8 @@ func listInvoices(ctx *cli.Context) error {
|
|||||||
IndexOffset: ctx.Uint64("index_offset"),
|
IndexOffset: ctx.Uint64("index_offset"),
|
||||||
NumMaxInvoices: ctx.Uint64("max_invoices"),
|
NumMaxInvoices: ctx.Uint64("max_invoices"),
|
||||||
Reversed: !ctx.Bool("paginate-forwards"),
|
Reversed: !ctx.Bool("paginate-forwards"),
|
||||||
|
CreationDateStart: ctx.Uint64("creation_date_start"),
|
||||||
|
CreationDateEnd: ctx.Uint64("creation_date_end"),
|
||||||
}
|
}
|
||||||
|
|
||||||
invoices, err := client.ListInvoices(ctxc, req)
|
invoices, err := client.ListInvoices(ctxc, req)
|
||||||
|
@@ -1229,6 +1229,18 @@ var listPaymentsCommand = cli.Command{
|
|||||||
"be counted; can take a long time on systems " +
|
"be counted; can take a long time on systems " +
|
||||||
"with many payments",
|
"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),
|
Action: actionDecorator(listPayments),
|
||||||
}
|
}
|
||||||
@@ -1244,6 +1256,8 @@ func listPayments(ctx *cli.Context) error {
|
|||||||
MaxPayments: uint64(ctx.Uint("max_payments")),
|
MaxPayments: uint64(ctx.Uint("max_payments")),
|
||||||
Reversed: !ctx.Bool("paginate_forwards"),
|
Reversed: !ctx.Bool("paginate_forwards"),
|
||||||
CountTotalPayments: ctx.Bool("count_total_payments"),
|
CountTotalPayments: ctx.Bool("count_total_payments"),
|
||||||
|
CreationDateStart: ctx.Uint64("creation_date_start"),
|
||||||
|
CreationDateEnd: ctx.Uint64("creation_date_end"),
|
||||||
}
|
}
|
||||||
|
|
||||||
payments, err := client.ListPayments(ctxc, req)
|
payments, err := client.ListPayments(ctxc, req)
|
||||||
|
Reference in New Issue
Block a user