Disable ethash by replacing with ethash.NewFullFake

This commit is contained in:
Jim Zhang 2018-03-18 22:48:07 -04:00
parent df4267a256
commit 2e19f7905d
1 changed files with 5 additions and 16 deletions

View File

@ -235,22 +235,11 @@ func CreateConsensusEngine(ctx *node.ServiceContext, config *Config, chainConfig
}
// Otherwise assume proof-of-work
switch {
case config.PowFake:
log.Warn("Ethash used in fake mode")
return ethash.NewFaker()
case config.PowTest:
log.Warn("Ethash used in test mode")
return ethash.NewTester()
case config.PowShared:
log.Warn("Ethash used in shared mode")
return ethash.NewShared()
default:
engine := ethash.New(ctx.ResolvePath(config.EthashCacheDir), config.EthashCachesInMem, config.EthashCachesOnDisk,
config.EthashDatasetDir, config.EthashDatasetsInMem, config.EthashDatasetsOnDisk)
engine.SetThreads(-1) // Disable CPU mining
return engine
}
// For Quorum, Raft run as a separate service, so
// the Ethereum service still needs a consensus engine,
// use the consensus with the lightest overhead
log.Warn("Ethash used in full fake mode")
return ethash.NewFullFaker()
}
// APIs returns the collection of RPC services the ethereum package offers.