aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2019-08-23 17:38:05 +0800
committerGitHub <noreply@github.com>2019-08-23 17:38:05 +0800
commitcc9eb91d30a5d4806154b832b9665aecc617b6d8 (patch)
tree02570dbfd7cf6de9849c00a7cb8c19918766d121 /core
parentc8a1c0a1156e23625cdca98b65286084609dca43 (diff)
parente39b2a2bde3f2f1a82f7836cf957af94a45acfc2 (diff)
downloadgo-tangerine-cc9eb91d30a5d4806154b832b9665aecc617b6d8.tar
go-tangerine-cc9eb91d30a5d4806154b832b9665aecc617b6d8.tar.gz
go-tangerine-cc9eb91d30a5d4806154b832b9665aecc617b6d8.tar.bz2
go-tangerine-cc9eb91d30a5d4806154b832b9665aecc617b6d8.tar.lz
go-tangerine-cc9eb91d30a5d4806154b832b9665aecc617b6d8.tar.xz
go-tangerine-cc9eb91d30a5d4806154b832b9665aecc617b6d8.tar.zst
go-tangerine-cc9eb91d30a5d4806154b832b9665aecc617b6d8.zip
Merge pull request #20004 from karalabe/istanbul-override
cmd, core, eth, les: support --override.istanbul
Diffstat (limited to 'core')
-rw-r--r--core/genesis.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/core/genesis.go b/core/genesis.go
index 5d6311b32..8261c18cc 100644
--- a/core/genesis.go
+++ b/core/genesis.go
@@ -152,6 +152,10 @@ 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, overrideIstanbul *big.Int) (*params.ChainConfig, common.Hash, error) {
if genesis != nil && genesis.Config == nil {
return params.AllEthashProtocolChanges, common.Hash{}, errGenesisNoConfig
}
@@ -200,6 +204,9 @@ func SetupGenesisBlock(db ethdb.Database, genesis *Genesis) (*params.ChainConfig
// Get the existing chain configuration.
newcfg := genesis.configOrDefault(stored)
+ if overrideIstanbul != nil {
+ newcfg.IstanbulBlock = overrideIstanbul
+ }
storedcfg := rawdb.ReadChainConfig(db, stored)
if storedcfg == nil {
log.Warn("Found genesis block without chain config")