cmd/lncli: add new include_incomplete flag for listpayments

This commit is contained in:
Olaoluwa Osuntokun 2019-06-13 16:05:52 -07:00
parent d333b2d981
commit 4584ea0681
No known key found for this signature in database
GPG Key ID: CE58F7F8E20FD9A2

@ -2839,14 +2839,22 @@ var listPaymentsCommand = cli.Command{
Name: "listpayments",
Category: "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 {
client, cleanUp := getClient(ctx)
defer cleanUp()
req := &lnrpc.ListPaymentsRequest{}
req := &lnrpc.ListPaymentsRequest{
IncludeIncomplete: ctx.Bool("include_incomplete"),
}
payments, err := client.ListPayments(context.Background(), req)
if err != nil {