Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

workaround: disable check for root presence #283

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions core/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -341,23 +341,23 @@ 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 header.Root != types.EmptyRootHash && !rawdb.HasLegacyTrieNode(db, header.Root) {
if genesis == nil {
genesis = DefaultGenesisBlock()
}
// Ensure the stored genesis matches with the given one.
hash := genesis.ToBlock().Hash()
if hash != stored {
return genesis.Config, hash, &GenesisMismatchError{stored, hash}
}
block, err := genesis.Commit(db, triedb)
if err != nil {
return genesis.Config, hash, err
}
applyOverrides(genesis.Config)
return genesis.Config, block.Hash(), nil
}
// header := rawdb.ReadHeader(db, stored, 0)
// if header.Root != types.EmptyRootHash && !rawdb.HasLegacyTrieNode(db, header.Root) {
// if genesis == nil {
// genesis = DefaultGenesisBlock()
// }
// // Ensure the stored genesis matches with the given one.
// hash := genesis.ToBlock().Hash()
// if hash != stored {
// return genesis.Config, hash, &GenesisMismatchError{stored, hash}
// }
// block, err := genesis.Commit(db, triedb)
// if err != nil {
// return genesis.Config, hash, err
// }
// applyOverrides(genesis.Config)
// return genesis.Config, block.Hash(), nil
// }
// Check whether the genesis block is already written.
if genesis != nil {
hash := genesis.ToBlock().Hash()
Expand Down