mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 01:43:47 +00:00
core: sanity-check fork configuration in genesis init
This commit is contained in:
parent
da71839a27
commit
d39546d765
1 changed files with 5 additions and 0 deletions
|
|
@ -364,6 +364,11 @@ func SetupGenesisBlockWithOverride(db ethdb.Database, triedb *triedb.Database, g
|
||||||
}
|
}
|
||||||
newCfg := genesis.chainConfigOrDefault(ghash, storedCfg)
|
newCfg := genesis.chainConfigOrDefault(ghash, storedCfg)
|
||||||
|
|
||||||
|
// Sanity-check the new configuration.
|
||||||
|
if err := newCfg.CheckConfigForkOrder(); err != nil {
|
||||||
|
return nil, common.Hash{}, nil, err
|
||||||
|
}
|
||||||
|
|
||||||
// TODO(rjl493456442) better to define the comparator of chain config
|
// TODO(rjl493456442) better to define the comparator of chain config
|
||||||
// and short circuit if the chain config is not changed.
|
// and short circuit if the chain config is not changed.
|
||||||
compatErr := storedCfg.CheckCompatible(newCfg, head.Number.Uint64(), head.Time)
|
compatErr := storedCfg.CheckCompatible(newCfg, head.Number.Uint64(), head.Time)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue