From 2c3420679dd9e7c6f5c1785647e8a264ebef8aa3 Mon Sep 17 00:00:00 2001 From: Slyghtning Date: Wed, 26 Jul 2023 17:45:38 +0200 Subject: [PATCH] lncli: add account to WalletBalance command --- cmd/lncli/commands.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/cmd/lncli/commands.go b/cmd/lncli/commands.go index 1a4e961ef0..1be06fd58c 100644 --- a/cmd/lncli/commands.go +++ b/cmd/lncli/commands.go @@ -1314,7 +1314,15 @@ var walletBalanceCommand = cli.Command{ Name: "walletbalance", Category: "Wallet", Usage: "Compute and display the wallet's current balance.", - Action: actionDecorator(walletBalance), + Flags: []cli.Flag{ + cli.StringFlag{ + Name: "account", + Usage: "(optional) the account for which the balance " + + "is shown", + Value: "", + }, + }, + Action: actionDecorator(walletBalance), } func walletBalance(ctx *cli.Context) error { @@ -1322,7 +1330,9 @@ func walletBalance(ctx *cli.Context) error { client, cleanUp := getClient(ctx) defer cleanUp() - req := &lnrpc.WalletBalanceRequest{} + req := &lnrpc.WalletBalanceRequest{ + Account: ctx.String("account"), + } resp, err := client.WalletBalance(ctxc, req) if err != nil { return err