aboutsummaryrefslogtreecommitdiffstats
path: root/eth/backend.go
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2015-07-07 17:55:23 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2015-07-07 17:55:23 +0800
commit916d1554675974adb92af4046e1b04ad3b26dca3 (patch)
tree6ab24e55a8b4bd14b3a9c25917d440c03b875bfc /eth/backend.go
parentd764bd058457cd9eb91d205d1ac187d40c4866d6 (diff)
parentc5cb6e8e70339b6641b7ce46cda04b83936213b3 (diff)
downloaddexon-916d1554675974adb92af4046e1b04ad3b26dca3.tar
dexon-916d1554675974adb92af4046e1b04ad3b26dca3.tar.gz
dexon-916d1554675974adb92af4046e1b04ad3b26dca3.tar.bz2
dexon-916d1554675974adb92af4046e1b04ad3b26dca3.tar.lz
dexon-916d1554675974adb92af4046e1b04ad3b26dca3.tar.xz
dexon-916d1554675974adb92af4046e1b04ad3b26dca3.tar.zst
dexon-916d1554675974adb92af4046e1b04ad3b26dca3.zip
Merge pull request #1429 from obscuren/rebase-registrar
Rebase registrar
Diffstat (limited to 'eth/backend.go')
-rw-r--r--eth/backend.go13
1 files changed, 12 insertions, 1 deletions
diff --git a/eth/backend.go b/eth/backend.go
index e62252b6c..38e06bcf8 100644
--- a/eth/backend.go
+++ b/eth/backend.go
@@ -70,6 +70,7 @@ type Config struct {
VmDebug bool
NatSpec bool
AutoDAG bool
+ PowTest bool
MaxPeers int
MaxPendingPeers int
@@ -221,6 +222,7 @@ type Ethereum struct {
NatSpec bool
DataDir string
AutoDAG bool
+ PowTest bool
autodagquit chan bool
etherbase common.Address
clientVersion string
@@ -329,6 +331,7 @@ func New(config *Config) (*Ethereum, error) {
MinerThreads: config.MinerThreads,
SolcPath: config.SolcPath,
AutoDAG: config.AutoDAG,
+ PowTest: config.PowTest,
GpoMinGasPrice: config.GpoMinGasPrice,
GpoMaxGasPrice: config.GpoMaxGasPrice,
GpoFullBlockRatio: config.GpoFullBlockRatio,
@@ -337,7 +340,15 @@ func New(config *Config) (*Ethereum, error) {
GpobaseCorrectionFactor: config.GpobaseCorrectionFactor,
}
- eth.pow = ethash.New()
+ if config.PowTest {
+ glog.V(logger.Info).Infof("ethash used in test mode")
+ eth.pow, err = ethash.NewForTesting()
+ if err != nil {
+ return nil, err
+ }
+ } else {
+ eth.pow = ethash.New()
+ }
genesis := core.GenesisBlock(uint64(config.GenesisNonce), stateDb)
eth.chainManager, err = core.NewChainManager(genesis, blockDb, stateDb, extraDb, eth.pow, eth.EventMux())
if err != nil {