diff --git a/x/auth/client/cli/query.go b/x/auth/client/cli/query.go index 24f5b9ed8baf..c566d8cb0db5 100644 --- a/x/auth/client/cli/query.go +++ b/x/auth/client/cli/query.go @@ -10,7 +10,6 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - clientrpc "github.com/cosmos/cosmos-sdk/client/rpc" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/types/query" @@ -101,11 +100,17 @@ func GetAccountCmd() *cobra.Command { queryClient := types.NewQueryClient(clientCtx) res, err := queryClient.Account(cmd.Context(), &types.QueryAccountRequest{Address: key.String()}) if err != nil { - height, err2 := clientrpc.GetChainHeight(clientCtx) - if err2 != nil { - return err2 + node, err := clientCtx.GetNode() + if err != nil { + return err } - if height != 0 { + status, err := node.Status(context.Background()) + if err != nil { + return err + } + catchingUp := status.SyncInfo.CatchingUp + + if !catchingUp { return errors.Wrapf(err, "your node may be syncing, please check node status using `/status`") } return err