aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/utils/flags.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/utils/flags.go')
-rw-r--r--cmd/utils/flags.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go
index 641ff6d40..52b78a5c3 100644
--- a/cmd/utils/flags.go
+++ b/cmd/utils/flags.go
@@ -825,6 +825,10 @@ func MakeChainConfigFromDb(ctx *cli.Context, db ethdb.Database) *params.ChainCon
Fatalf("Could not make chain configuration: %v", err)
}
}
+ // set chain id in case it's zero.
+ if config.ChainId == nil {
+ config.ChainId = new(big.Int)
+ }
// Check whether we are allowed to set default config params or not:
// - If no genesis is set, we're running either mainnet or testnet (private nets use `geth init`)
// - If a genesis is already set, ensure we have a configuration for it (mainnet or testnet)