core: check genesis state presence by disk read (#26703)

pull/26707/head
rjl493456442 2 years ago committed by GitHub
parent 5ccc99b258
commit 08bf8a60c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      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()
}

Loading…
Cancel
Save