Skip to content

Commit

Permalink
Fixes return/break
Browse files Browse the repository at this point in the history
  • Loading branch information
amir20 committed Nov 11, 2017
1 parent cb7fddc commit 1fdcc05
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions main.go
Expand Up @@ -62,7 +62,7 @@ func mine(start uint64, bytes []byte, found chan<- uint64, abort <-chan struct{}
for {
select {
case <-abort:
break
return

default:
binary.LittleEndian.PutUint64(buffer[total:], nonce)
Expand All @@ -71,15 +71,14 @@ func mine(start uint64, bytes []byte, found chan<- uint64, abort <-chan struct{}

if value.Cmp(threshold) <= 0 {
found <- nonce
break
return
}

nonce++
attempt++
if attempt%(1<<16) == 0 {
meter.Mark(attempt)
attempt = 0

}
}
}
Expand Down

0 comments on commit 1fdcc05

Please sign in to comment.