mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 02:40:45 +00:00
Reset hash rate to 0 when mining is stopped
This commit is contained in:
parent
6a7b0ef904
commit
4d49d7b5a6
1 changed files with 2 additions and 1 deletions
|
|
@ -42,6 +42,8 @@ func (pow *EasyPow) Search(block pow.Block, stop <-chan struct{}) []byte {
|
||||||
starti := i
|
starti := i
|
||||||
start := time.Now().UnixNano()
|
start := time.Now().UnixNano()
|
||||||
|
|
||||||
|
defer func() { pow.HashRate = 0 }()
|
||||||
|
|
||||||
// Make sure stop is empty
|
// Make sure stop is empty
|
||||||
empty:
|
empty:
|
||||||
for {
|
for {
|
||||||
|
|
@ -55,7 +57,6 @@ empty:
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case <-stop:
|
case <-stop:
|
||||||
pow.HashRate = 0
|
|
||||||
return nil
|
return nil
|
||||||
default:
|
default:
|
||||||
i++
|
i++
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue