From 1fdcc05c12e516496421387d4a9b5a30e5c8a335 Mon Sep 17 00:00:00 2001 From: Amir Raminfar Date: Sat, 11 Nov 2017 14:08:12 -0800 Subject: [PATCH] Fixes return/break --- main.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index dd5eb7f..89fb560 100644 --- a/main.go +++ b/main.go @@ -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) @@ -71,7 +71,7 @@ func mine(start uint64, bytes []byte, found chan<- uint64, abort <-chan struct{} if value.Cmp(threshold) <= 0 { found <- nonce - break + return } nonce++ @@ -79,7 +79,6 @@ func mine(start uint64, bytes []byte, found chan<- uint64, abort <-chan struct{} if attempt%(1<<16) == 0 { meter.Mark(attempt) attempt = 0 - } } }