aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorMartin Holst Swende <martin@swende.se>2018-12-11 20:19:03 +0800
committerPéter Szilágyi <peterke@gmail.com>2018-12-11 20:19:03 +0800
commit83a9a73b899e816a0d1493b7fb1e37abe4bc4566 (patch)
treea813e0e451a7a44ee12c91e40bcd76041f793895 /core
parent5584574217df29f5daf5db70b3d2536ec66a036c (diff)
downloaddexon-83a9a73b899e816a0d1493b7fb1e37abe4bc4566.tar
dexon-83a9a73b899e816a0d1493b7fb1e37abe4bc4566.tar.gz
dexon-83a9a73b899e816a0d1493b7fb1e37abe4bc4566.tar.bz2
dexon-83a9a73b899e816a0d1493b7fb1e37abe4bc4566.tar.lz
dexon-83a9a73b899e816a0d1493b7fb1e37abe4bc4566.tar.xz
dexon-83a9a73b899e816a0d1493b7fb1e37abe4bc4566.tar.zst
dexon-83a9a73b899e816a0d1493b7fb1e37abe4bc4566.zip
cmd/geth, core, eth: implement Constantinople override flag (#18273)
* geth/core/eth: implement constantinople override flag * les: implemnent constantinople override flag for les clients * cmd/geth, eth, les: fix typo, move flag to experimentals
Diffstat (limited to 'core')
-rw-r--r--core/genesis.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/genesis.go b/core/genesis.go
index 6e71afd61..c96cb17a3 100644
--- a/core/genesis.go
+++ b/core/genesis.go
@@ -151,6 +151,9 @@ func (e *GenesisMismatchError) Error() string {
//
// The returned chain configuration is never nil.
func SetupGenesisBlock(db ethdb.Database, genesis *Genesis) (*params.ChainConfig, common.Hash, error) {
+ return SetupGenesisBlockWithOverride(db, genesis, nil)
+}
+func SetupGenesisBlockWithOverride(db ethdb.Database, genesis *Genesis, constantinopleOverride *big.Int) (*params.ChainConfig, common.Hash, error) {
if genesis != nil && genesis.Config == nil {
return params.AllEthashProtocolChanges, common.Hash{}, errGenesisNoConfig
}
@@ -178,6 +181,9 @@ func SetupGenesisBlock(db ethdb.Database, genesis *Genesis) (*params.ChainConfig
// Get the existing chain configuration.
newcfg := genesis.configOrDefault(stored)
+ if constantinopleOverride != nil {
+ newcfg.ConstantinopleBlock = constantinopleOverride
+ }
storedcfg := rawdb.ReadChainConfig(db, stored)
if storedcfg == nil {
log.Warn("Found genesis block without chain config")