Skip to content

Commit 640d2c5

Browse files
authored
Merge pull request #22803 from karalabe/silence-scary-warning
eth: don't print db upgrade warning on db init
2 parents fc1c1cb + 856c379 commit 640d2c5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

eth/backend.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,9 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) {
165165
if bcVersion != nil && *bcVersion > core.BlockChainVersion {
166166
return nil, fmt.Errorf("database version is v%d, Geth %s only supports v%d", *bcVersion, params.VersionWithMeta, core.BlockChainVersion)
167167
} else if bcVersion == nil || *bcVersion < core.BlockChainVersion {
168-
log.Warn("Upgrade blockchain database version", "from", dbVer, "to", core.BlockChainVersion)
168+
if bcVersion != nil { // only print warning on upgrade, not on init
169+
log.Warn("Upgrade blockchain database version", "from", dbVer, "to", core.BlockChainVersion)
170+
}
169171
rawdb.WriteDatabaseVersion(chainDb, core.BlockChainVersion)
170172
}
171173
}

0 commit comments

Comments
 (0)