aboutsummaryrefslogtreecommitdiffstats
path: root/eth
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2016-02-24 23:58:12 +0800
committerPéter Szilágyi <peterke@gmail.com>2016-02-24 23:58:12 +0800
commita6903ad6a5b2cd8bb02ad85a9a612b575baf8362 (patch)
tree6119e06f9e1a013f7d31e62eeb3f78ea35003364 /eth
parent66b148dd8f4895dbdedda36030e2ef0c994bea40 (diff)
parent0a5ee08e2b8927016f9f8d2afe0ac30e9ac0e81f (diff)
downloadgo-tangerine-a6903ad6a5b2cd8bb02ad85a9a612b575baf8362.tar
go-tangerine-a6903ad6a5b2cd8bb02ad85a9a612b575baf8362.tar.gz
go-tangerine-a6903ad6a5b2cd8bb02ad85a9a612b575baf8362.tar.bz2
go-tangerine-a6903ad6a5b2cd8bb02ad85a9a612b575baf8362.tar.lz
go-tangerine-a6903ad6a5b2cd8bb02ad85a9a612b575baf8362.tar.xz
go-tangerine-a6903ad6a5b2cd8bb02ad85a9a612b575baf8362.tar.zst
go-tangerine-a6903ad6a5b2cd8bb02ad85a9a612b575baf8362.zip
Merge pull request #2260 from karalabe/ethash-cache-fixes
Godeps, eth, tests: update ethash, used shared for testing
Diffstat (limited to 'eth')
-rw-r--r--eth/backend.go11
1 files changed, 8 insertions, 3 deletions
diff --git a/eth/backend.go b/eth/backend.go
index 2f0bc3ee5..f62ee976d 100644
--- a/eth/backend.go
+++ b/eth/backend.go
@@ -74,6 +74,7 @@ type Config struct {
DocRoot string
AutoDAG bool
PowTest bool
+ PowShared bool
ExtraData []byte
AccountManager *accounts.Manager
@@ -211,14 +212,18 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) {
GpobaseCorrectionFactor: config.GpobaseCorrectionFactor,
httpclient: httpclient.New(config.DocRoot),
}
-
- if config.PowTest {
+ switch {
+ case config.PowTest:
glog.V(logger.Info).Infof("ethash used in test mode")
eth.pow, err = ethash.NewForTesting()
if err != nil {
return nil, err
}
- } else {
+ case config.PowShared:
+ glog.V(logger.Info).Infof("ethash used in shared mode")
+ eth.pow = ethash.NewShared()
+
+ default:
eth.pow = ethash.New()
}
//genesis := core.GenesisBlock(uint64(config.GenesisNonce), stateDb)