Co-authored-by: Alex Sharov <AskAlexSharov@gmail.com>
This commit is contained in:
ledgerwatch 2021-11-30 12:36:01 +00:00 committed by GitHub
parent 778ee5ba0d
commit feebc7d3e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 18 deletions

View File

@ -145,8 +145,7 @@ func resetExec(tx kv.RwTx, g *core.Genesis) error {
return err
}
_, _, err := core.OverrideGenesisBlock(tx, g)
if err != nil {
if _, _, err := g.WriteGenesisState(tx); err != nil {
return err
}
return nil

View File

@ -194,22 +194,6 @@ func MustCommitGenesisBlock(db kv.RwDB, genesis *Genesis) (*params.ChainConfig,
return c, b
}
func OverrideGenesisBlock(db kv.RwTx, genesis *Genesis) (*params.ChainConfig, *types.Block, error) {
stored, err := rawdb.ReadCanonicalHash(db, 0)
if err != nil {
return nil, nil, err
}
err = rawdb.DeleteCanonicalHash(db, 0)
if err != nil {
return nil, nil, err
}
err = rawdb.DeleteChainConfig(db, stored)
if err != nil {
return nil, nil, err
}
return WriteGenesisBlock(db, genesis)
}
func WriteGenesisBlock(db kv.RwTx, genesis *Genesis) (*params.ChainConfig, *types.Block, error) {
if genesis != nil && genesis.Config == nil {
return params.AllEthashProtocolChanges, nil, ErrGenesisNoConfig