mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-04 09:48:19 +01:00
lncli: add account to WalletBalance command
This commit is contained in:
parent
dd2a89a6ee
commit
2c3420679d
1 changed files with 12 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue