mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 18:32:23 +00:00
workaround: disable check for root presence (#283)
This commit is contained in:
parent
5032dd480b
commit
990395c688
1 changed files with 17 additions and 17 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Reference in a new issue