From 7a6c6ec9469722abca93f94c4a3725f026ab09bc Mon Sep 17 00:00:00 2001 From: Jeffrey Wilcke Date: Mon, 14 Nov 2016 17:23:39 +0100 Subject: cmd/utils, params: define chain ids --- cmd/utils/flags.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'cmd/utils/flags.go') diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 2d6bb4f5b..f86fc37f5 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -881,6 +881,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 } -- cgit v1.2.3