cmd/utils, params: define chain ids

This commit is contained in:
Jeffrey Wilcke 2016-11-14 17:23:39 +01:00
parent 6c9c1e6712
commit 7a6c6ec946
2 changed files with 10 additions and 0 deletions

View File

@ -881,6 +881,13 @@ func MakeChainConfigFromDb(ctx *cli.Context, db ethdb.Database) *params.ChainCon
config.EIP158Block = params.MainNetSpuriousDragon 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 config.DAOForkSupport = true
} }

View File

@ -37,4 +37,7 @@ var (
TestNetSpuriousDragon = big.NewInt(3000000) TestNetSpuriousDragon = big.NewInt(3000000)
MainNetSpuriousDragon = big.NewInt(3000000) MainNetSpuriousDragon = big.NewInt(3000000)
TestNetChainID = big.NewInt(2) // Test net default chain ID
MainNetChainID = big.NewInt(1) // main net default chain ID
) )