eth: polish error message

This commit is contained in:
rjl493456442 2019-01-11 16:23:14 +08:00
parent 60c0f7f811
commit 141ec37e79

View file

@ -144,9 +144,9 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) {
if !config.SkipBcVersionCheck {
bcVersion := rawdb.ReadDatabaseVersion(chainDb)
if bcVersion != nil && *bcVersion > core.BlockChainVersion {
return nil, fmt.Errorf("Blockchain DB version mismatch (%d / %d).\n", *bcVersion, core.BlockChainVersion)
return nil, fmt.Errorf("database version is v%d, Geth %s only supports v%d", *bcVersion, params.VersionWithMeta, core.BlockChainVersion)
} else if bcVersion != nil && *bcVersion < core.BlockChainVersion {
log.Warn("Upgrade blockchain DB version", "from", *bcVersion, "to", core.BlockChainVersion)
log.Warn("Upgrade blockchain database version", "from", *bcVersion, "to", core.BlockChainVersion)
}
rawdb.WriteDatabaseVersion(chainDb, core.BlockChainVersion)
}