aboutsummaryrefslogtreecommitdiffstats
path: root/eth
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2015-09-11 03:15:33 +0800
committerFelix Lange <fjl@twurst.com>2015-09-11 03:15:33 +0800
commit4e075e401354b4ee068cf78b1f283763fe927245 (patch)
tree09de03b1fb972223932e8a9388379bbf0e3bc6e4 /eth
parent62bbf8a09e7304611f57fb7eea92911cf52e6229 (diff)
parentf04b3a6f293ef15151dc040183ab74ef5ce54d2a (diff)
downloadgo-tangerine-4e075e401354b4ee068cf78b1f283763fe927245.tar
go-tangerine-4e075e401354b4ee068cf78b1f283763fe927245.tar.gz
go-tangerine-4e075e401354b4ee068cf78b1f283763fe927245.tar.bz2
go-tangerine-4e075e401354b4ee068cf78b1f283763fe927245.tar.lz
go-tangerine-4e075e401354b4ee068cf78b1f283763fe927245.tar.xz
go-tangerine-4e075e401354b4ee068cf78b1f283763fe927245.tar.zst
go-tangerine-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.go15
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)
}