mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-25 13:07:17 +00:00
Co-authored-by: Alex Sharov <AskAlexSharov@gmail.com>
This commit is contained in:
parent
778ee5ba0d
commit
feebc7d3e6
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user