diff options
author | Péter Szilágyi <peterke@gmail.com> | 2017-04-09 01:40:54 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-09 01:40:54 +0800 |
commit | badbaf66b6efe454ac02d0a6ce1ae964f7fa67c0 (patch) | |
tree | ffa8ffe28b6e7539cfd9baa6aa0b3c48522b91fc /consensus/ethash/sealer.go | |
parent | cc13d576f07fb6803e09fb42880591a67b8b0ef6 (diff) | |
parent | b801be99d47ba09121a3e7d14aa028f828525b61 (diff) | |
download | go-tangerine-badbaf66b6efe454ac02d0a6ce1ae964f7fa67c0.tar go-tangerine-badbaf66b6efe454ac02d0a6ce1ae964f7fa67c0.tar.gz go-tangerine-badbaf66b6efe454ac02d0a6ce1ae964f7fa67c0.tar.bz2 go-tangerine-badbaf66b6efe454ac02d0a6ce1ae964f7fa67c0.tar.lz go-tangerine-badbaf66b6efe454ac02d0a6ce1ae964f7fa67c0.tar.xz go-tangerine-badbaf66b6efe454ac02d0a6ce1ae964f7fa67c0.tar.zst go-tangerine-badbaf66b6efe454ac02d0a6ce1ae964f7fa67c0.zip |
Merge pull request #13880 from karalabe/remote-miner-fix
consensus/ethash, eth: don't mine if 0 threads are set
Diffstat (limited to 'consensus/ethash/sealer.go')
-rw-r--r-- | consensus/ethash/sealer.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/consensus/ethash/sealer.go b/consensus/ethash/sealer.go index 9a000ed31..784e8f649 100644 --- a/consensus/ethash/sealer.go +++ b/consensus/ethash/sealer.go @@ -61,6 +61,9 @@ func (ethash *Ethash) Seal(chain consensus.ChainReader, block *types.Block, stop if threads == 0 { threads = runtime.NumCPU() } + if threads < 0 { + threads = 0 // Allows disabling local mining without extra logic around local/remote + } var pend sync.WaitGroup for i := 0; i < threads; i++ { pend.Add(1) |