aboutsummaryrefslogtreecommitdiffstats
path: root/pow
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-02-14 01:30:06 +0800
committerobscuren <geffobscura@gmail.com>2015-02-14 01:30:06 +0800
commit4d49d7b5a64774990c55dc2046195985bd716259 (patch)
treef3794d7d935624e0beda8af15a22d1bc4dbce529 /pow
parent6a7b0ef904def27c535cba6f85d686bc4dbab281 (diff)
downloadgo-tangerine-4d49d7b5a64774990c55dc2046195985bd716259.tar
go-tangerine-4d49d7b5a64774990c55dc2046195985bd716259.tar.gz
go-tangerine-4d49d7b5a64774990c55dc2046195985bd716259.tar.bz2
go-tangerine-4d49d7b5a64774990c55dc2046195985bd716259.tar.lz
go-tangerine-4d49d7b5a64774990c55dc2046195985bd716259.tar.xz
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.go3
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++