|
|
@ -41,8 +41,7 @@ type Miner struct { |
|
|
|
func (job *Job) submit(nonce string) bool { |
|
|
|
func (job *Job) submit(nonce string) bool { |
|
|
|
job.Lock() |
|
|
|
job.Lock() |
|
|
|
defer job.Unlock() |
|
|
|
defer job.Unlock() |
|
|
|
_, exist := job.submissions[nonce] |
|
|
|
if _, exist := job.submissions[nonce]; exist { |
|
|
|
if exist { |
|
|
|
|
|
|
|
return true |
|
|
|
return true |
|
|
|
} |
|
|
|
} |
|
|
|
job.submissions[nonce] = struct{}{} |
|
|
|
job.submissions[nonce] = struct{}{} |
|
|
|