cli: use default address in wallet balance when none specified

This commit is contained in:
Łukasz Magiera 2019-07-25 16:18:55 +02:00
parent 14be8d68a7
commit 2c362f4930

View File

@ -75,7 +75,12 @@ var walletBalance = &cli.Command{
}
ctx := ReqContext(cctx)
addr, err := address.NewFromString(cctx.Args().First())
var addr address.Address
if cctx.Args().First() != "" {
addr, err = address.NewFromString(cctx.Args().First())
} else {
addr, err = api.WalletDefaultAddress(ctx)
}
if err != nil {
return err
}