cli: use default address in wallet balance when none specified
This commit is contained in:
parent
14be8d68a7
commit
2c362f4930
@ -75,7 +75,12 @@ var walletBalance = &cli.Command{
|
|||||||
}
|
}
|
||||||
ctx := ReqContext(cctx)
|
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 {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user