Skip to content

Commit

Permalink
Normalize the case to prevent duplication of valid shares by the client
Browse files Browse the repository at this point in the history
  • Loading branch information
CryptoManiac committed Apr 14, 2015
1 parent 1ea0894 commit 3a16365
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/template_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,12 @@ def submit_share(self, job_id, worker_name, session, extranonce1_bin, extranonce
# Check nonce
if len(nonce) != 8:
raise SubmitException("Incorrect size of nonce. Expected 8 chars")


# normalize the case to prevent duplication of valid shares by the client
ntime = ntile.lower()
nonce = nonce.lower()
extranonce2 = extranonce2.lower()

# Check for duplicated submit
if not job.register_submit(extranonce1_bin, extranonce2, ntime, nonce):
log.info("Duplicate from %s, (%s %s %s %s)" % \
Expand Down

0 comments on commit 3a16365

Please sign in to comment.