lncli: add account to WalletBalance command

This commit is contained in:
Slyghtning 2023-07-26 17:45:38 +02:00
parent dd2a89a6ee
commit 2c3420679d
No known key found for this signature in database
GPG key ID: F82D456EA023C9BF

View file

@ -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