diff options
Diffstat (limited to 'cmd/utils/flags.go')
-rw-r--r-- | cmd/utils/flags.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 1ba905657..6d9482e69 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -906,6 +906,13 @@ func MakeChainConfigFromDb(ctx *cli.Context, db ethdb.Database) *params.ChainCon config.EIP158Block = params.MainNetSpuriousDragon } } + if config.ChainId.BitLen() == 0 { + if ctx.GlobalBool(TestNetFlag.Name) { + config.ChainId = params.TestNetChainID + } else { + config.ChainId = params.MainNetChainID + } + } config.DAOForkSupport = true } |