From 08bf8a60c3b1dec73c67a187093cd066021d0453 Mon Sep 17 00:00:00 2001 From: rjl493456442 Date: Thu, 16 Feb 2023 18:09:41 +0800 Subject: [PATCH] core: check genesis state presence by disk read (#26703) --- core/genesis.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/genesis.go b/core/genesis.go index 1120be015..5a6c409e0 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -317,7 +317,7 @@ func SetupGenesisBlockWithOverride(db ethdb.Database, triedb *trie.Database, gen // We have the genesis block in database(perhaps in ancient database) // but the corresponding state is missing. header := rawdb.ReadHeader(db, stored, 0) - if _, err := state.New(header.Root, state.NewDatabaseWithNodeDB(db, triedb), nil); err != nil { + if header.Root != types.EmptyRootHash && !rawdb.HasLegacyTrieNode(db, header.Root) { if genesis == nil { genesis = DefaultGenesisBlock() }