diff options
author | Jeffrey Wilcke <geffobscura@gmail.com> | 2015-08-03 23:48:24 +0800 |
---|---|---|
committer | Jeffrey Wilcke <geffobscura@gmail.com> | 2015-08-04 00:15:48 +0800 |
commit | dcdb7059cc69ee4e77518b8dd92d5c7037aa3c8d (patch) | |
tree | 6c3e0c5b59ce2ec6515b4ce96d84421b9b635d94 /cmd/utils/flags.go | |
parent | e7f4232b10034d291d1757b96e6277908618223c (diff) | |
download | dexon-dcdb7059cc69ee4e77518b8dd92d5c7037aa3c8d.tar dexon-dcdb7059cc69ee4e77518b8dd92d5c7037aa3c8d.tar.gz dexon-dcdb7059cc69ee4e77518b8dd92d5c7037aa3c8d.tar.bz2 dexon-dcdb7059cc69ee4e77518b8dd92d5c7037aa3c8d.tar.lz dexon-dcdb7059cc69ee4e77518b8dd92d5c7037aa3c8d.tar.xz dexon-dcdb7059cc69ee4e77518b8dd92d5c7037aa3c8d.tar.zst dexon-dcdb7059cc69ee4e77518b8dd92d5c7037aa3c8d.zip |
cmd, core, eth: support for the olympic network
Added a --olympic flag which initialiser the olympic protocol settings
Diffstat (limited to 'cmd/utils/flags.go')
-rw-r--r-- | cmd/utils/flags.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index b66fe24cc..d283329f1 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -131,6 +131,10 @@ var ( Usage: "Megabytes of memory allocated to internal caching", Value: 0, } + OlympicFlag = cli.BoolFlag{ + Name: "olympic", + Usage: "Use olympic style protocol", + } // miner settings MinerThreadsFlag = cli.IntFlag{ @@ -402,6 +406,7 @@ func MakeEthConfig(clientID, version string, ctx *cli.Context) *eth.Config { MaxPeers: ctx.GlobalInt(MaxPeersFlag.Name), MaxPendingPeers: ctx.GlobalInt(MaxPendingPeersFlag.Name), Port: ctx.GlobalString(ListenPortFlag.Name), + Olympic: ctx.GlobalBool(OlympicFlag.Name), NAT: MakeNAT(ctx), NatSpec: ctx.GlobalBool(NatspecEnabledFlag.Name), Discovery: !ctx.GlobalBool(NoDiscoverFlag.Name), @@ -444,6 +449,13 @@ func MakeChain(ctx *cli.Context) (chain *core.ChainManager, blockDB, stateDB, ex if extraDB, err = ethdb.NewLDBDatabase(filepath.Join(datadir, "extra"), cache); err != nil { Fatalf("Could not open database: %v", err) } + if ctx.GlobalBool(OlympicFlag.Name) { + InitOlympic() + _, err := core.WriteTestNetGenesisBlock(stateDB, blockDB, 42) + if err != nil { + glog.Fatalln(err) + } + } eventMux := new(event.TypeMux) pow := ethash.New() |