cmd, core, eth: support for the olympic network

Added a --olympic flag which initialiser the olympic protocol settings
This commit is contained in:
Jeffrey Wilcke
2015-08-03 17:48:24 +02:00
parent e7f4232b10
commit dcdb7059cc
4 changed files with 42 additions and 0 deletions

View File

@ -78,6 +78,7 @@ type Config struct {
GenesisNonce int
GenesisFile string
GenesisBlock *types.Block // used by block tests
Olympic bool
BlockChainVersion int
SkipBcVersionCheck bool // e.g. blockchain export
@ -302,6 +303,14 @@ func New(config *Config) (*Ethereum, error) {
glog.V(logger.Info).Infof("Successfully wrote genesis block. New genesis hash = %x\n", block.Hash())
}
if config.Olympic {
_, err := core.WriteTestNetGenesisBlock(stateDb, blockDb, 42)
if err != nil {
return nil, err
}
glog.V(logger.Error).Infoln("Starting Olympic network")
}
// This is for testing only.
if config.GenesisBlock != nil {
core.WriteBlock(blockDb, config.GenesisBlock)