diff options
author | obscuren <geffobscura@gmail.com> | 2015-02-14 01:30:06 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-02-14 01:30:06 +0800 |
commit | 4d49d7b5a64774990c55dc2046195985bd716259 (patch) | |
tree | f3794d7d935624e0beda8af15a22d1bc4dbce529 /pow | |
parent | 6a7b0ef904def27c535cba6f85d686bc4dbab281 (diff) | |
download | go-tangerine-4d49d7b5a64774990c55dc2046195985bd716259.tar.gz go-tangerine-4d49d7b5a64774990c55dc2046195985bd716259.tar.zst go-tangerine-4d49d7b5a64774990c55dc2046195985bd716259.zip |
Reset hash rate to 0 when mining is stopped
Diffstat (limited to 'pow')
-rw-r--r-- | pow/ezp/pow.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/pow/ezp/pow.go b/pow/ezp/pow.go index 5571e73cd..f4a8b80e5 100644 --- a/pow/ezp/pow.go +++ b/pow/ezp/pow.go @@ -42,6 +42,8 @@ func (pow *EasyPow) Search(block pow.Block, stop <-chan struct{}) []byte { starti := i start := time.Now().UnixNano() + defer func() { pow.HashRate = 0 }() + // Make sure stop is empty empty: for { @@ -55,7 +57,6 @@ empty: for { select { case <-stop: - pow.HashRate = 0 return nil default: i++ |