core, core/types: refactored tx chain id checking (#3257)

* core, core/types: refactored tx chain id checking

Refactored explicit chain id checking in to the Sender deriviation method

* cmd/utils, params: define chain ids
This commit is contained in:
Jeffrey Wilcke
2016-11-14 21:37:13 +01:00
committed by GitHub
6 changed files with 58 additions and 12 deletions

View File

@ -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
}