mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-12 22:59:38 +02:00
lncli: add account to WalletBalance command
This commit is contained in:
@@ -1314,7 +1314,15 @@ var walletBalanceCommand = cli.Command{
|
|||||||
Name: "walletbalance",
|
Name: "walletbalance",
|
||||||
Category: "Wallet",
|
Category: "Wallet",
|
||||||
Usage: "Compute and display the wallet's current balance.",
|
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 {
|
func walletBalance(ctx *cli.Context) error {
|
||||||
@@ -1322,7 +1330,9 @@ func walletBalance(ctx *cli.Context) error {
|
|||||||
client, cleanUp := getClient(ctx)
|
client, cleanUp := getClient(ctx)
|
||||||
defer cleanUp()
|
defer cleanUp()
|
||||||
|
|
||||||
req := &lnrpc.WalletBalanceRequest{}
|
req := &lnrpc.WalletBalanceRequest{
|
||||||
|
Account: ctx.String("account"),
|
||||||
|
}
|
||||||
resp, err := client.WalletBalance(ctxc, req)
|
resp, err := client.WalletBalance(ctxc, req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
Reference in New Issue
Block a user