Skip to content

Commit

Permalink
lncli: add account to WalletBalance command
Browse files Browse the repository at this point in the history
  • Loading branch information
hieblmi committed Jul 28, 2023
1 parent dd2a89a commit 2c34206
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions cmd/lncli/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -1314,15 +1314,25 @@ 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 {
ctxc := getContext()
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
Expand Down

0 comments on commit 2c34206

Please sign in to comment.