Implement command line argument to set the amount of agents created by the miner

Defaults to the amount of cores available on the CPU
This commit is contained in:
Maran
2015-02-19 10:38:36 +01:00
parent ee9df32dba
commit 5aff8bfb59
5 changed files with 23 additions and 17 deletions

View File

@ -53,6 +53,8 @@ type Config struct {
Shh bool
Dial bool
MinerThreads int
KeyManager *crypto.KeyManager
}
@ -153,7 +155,7 @@ func New(config *Config) (*Ethereum, error) {
eth.blockProcessor = core.NewBlockProcessor(db, eth.txPool, eth.chainManager, eth.EventMux())
eth.chainManager.SetProcessor(eth.blockProcessor)
eth.whisper = whisper.New()
eth.miner = miner.New(keyManager.Address(), eth)
eth.miner = miner.New(keyManager.Address(), eth, config.MinerThreads)
hasBlock := eth.chainManager.HasBlock
insertChain := eth.chainManager.InsertChain