Merge pull request #24281 from karalabe/dev-read-write

cmd/utils: fix regression placing dev mode datadir readonly
This commit is contained in:
Péter Szilágyi 2022-01-24 10:35:39 +02:00 committed by GitHub
commit f9ce40bb84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1675,7 +1675,7 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
if ctx.GlobalIsSet(DataDirFlag.Name) {
// Check if we have an already initialized chain and fall back to
// that if so. Otherwise we need to generate a new genesis spec.
chaindb := MakeChainDatabase(ctx, stack, true)
chaindb := MakeChainDatabase(ctx, stack, false)
if rawdb.ReadCanonicalHash(chaindb, 0) != (common.Hash{}) {
cfg.Genesis = nil // fallback to db content
}