diff options
author | Felix Lange <fjl@twurst.com> | 2015-09-11 03:15:33 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2015-09-11 03:15:33 +0800 |
commit | 4e075e401354b4ee068cf78b1f283763fe927245 (patch) | |
tree | 09de03b1fb972223932e8a9388379bbf0e3bc6e4 /eth | |
parent | 62bbf8a09e7304611f57fb7eea92911cf52e6229 (diff) | |
parent | f04b3a6f293ef15151dc040183ab74ef5ce54d2a (diff) | |
download | dexon-4e075e401354b4ee068cf78b1f283763fe927245.tar dexon-4e075e401354b4ee068cf78b1f283763fe927245.tar.gz dexon-4e075e401354b4ee068cf78b1f283763fe927245.tar.bz2 dexon-4e075e401354b4ee068cf78b1f283763fe927245.tar.lz dexon-4e075e401354b4ee068cf78b1f283763fe927245.tar.xz dexon-4e075e401354b4ee068cf78b1f283763fe927245.tar.zst dexon-4e075e401354b4ee068cf78b1f283763fe927245.zip |
Merge pull request #1773 from obscuren/dev-mode
cmd/geth, cmd/utils, eth: added dev mode flag
Diffstat (limited to 'eth')
-rw-r--r-- | eth/backend.go | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/eth/backend.go b/eth/backend.go index ad2a2c1f9..639aaaaec 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -73,6 +73,8 @@ var ( ) type Config struct { + DevMode bool + Name string NetworkId int GenesisNonce int @@ -303,16 +305,17 @@ 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 { + // different modes + switch { + case config.Olympic: + glog.V(logger.Error).Infoln("Starting Olympic network") + fallthrough + case config.DevMode: _, err := core.WriteTestNetGenesisBlock(chainDb, 42) if err != nil { return nil, err } - glog.V(logger.Error).Infoln("Starting Olympic network") - } - - // This is for testing only. - if config.GenesisBlock != nil { + case config.GenesisBlock != nil: // This is for testing only. core.WriteBlock(chainDb, config.GenesisBlock) core.WriteHead(chainDb, config.GenesisBlock) } |