mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-28 10:41:57 +01:00
cmd/lncli: add new include_incomplete flag for listpayments
This commit is contained in:
parent
d333b2d981
commit
4584ea0681
@ -2839,14 +2839,22 @@ var listPaymentsCommand = cli.Command{
|
|||||||
Name: "listpayments",
|
Name: "listpayments",
|
||||||
Category: "Payments",
|
Category: "Payments",
|
||||||
Usage: "List all outgoing payments.",
|
Usage: "List all outgoing payments.",
|
||||||
Action: actionDecorator(listPayments),
|
Flags: []cli.Flag{
|
||||||
|
cli.BoolFlag{
|
||||||
|
Name: "include_incomplete",
|
||||||
|
Usage: "if set to true, payments still in flight (or failed) will be returned as well",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Action: actionDecorator(listPayments),
|
||||||
}
|
}
|
||||||
|
|
||||||
func listPayments(ctx *cli.Context) error {
|
func listPayments(ctx *cli.Context) error {
|
||||||
client, cleanUp := getClient(ctx)
|
client, cleanUp := getClient(ctx)
|
||||||
defer cleanUp()
|
defer cleanUp()
|
||||||
|
|
||||||
req := &lnrpc.ListPaymentsRequest{}
|
req := &lnrpc.ListPaymentsRequest{
|
||||||
|
IncludeIncomplete: ctx.Bool("include_incomplete"),
|
||||||
|
}
|
||||||
|
|
||||||
payments, err := client.ListPayments(context.Background(), req)
|
payments, err := client.ListPayments(context.Background(), req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user