Browse Source

Merge commit 'e19c5d9' into bfgminer

Luke Dashjr 13 years ago
parent
commit
6c63b68af0
1 changed files with 3 additions and 4 deletions
  1. 3 4
      miner.c

+ 3 - 4
miner.c

@@ -3623,11 +3623,10 @@ next_submit:
 		char *noncehex;
 		char s[1024];
 
-		/* Give the stratum share a unique id */
-		swork_id++;
 		memcpy(&sshare->work, work, sizeof(struct work));
 		mutex_lock(&sshare_lock);
-		sshare->id = swork_id;
+		/* Give the stratum share a unique id */
+		sshare->id = swork_id++;
 		HASH_ADD_INT(stratum_shares, id, sshare);
 		mutex_unlock(&sshare_lock);
 
@@ -3635,7 +3634,7 @@ next_submit:
 		noncehex = bin2hex((const unsigned char *)&nonce, 4);
 		memset(s, 0, 1024);
 		sprintf(s, "{\"params\": [\"%s\", \"%s\", \"%s\", \"%s\", \"%s\"], \"id\": %d, \"method\": \"mining.submit\"}",
-			pool->rpc_user, work->job_id, work->nonce2, work->ntime, noncehex, swork_id);
+			pool->rpc_user, work->job_id, work->nonce2, work->ntime, noncehex, sshare->id);
 		free(noncehex);
 
 		applog(LOG_DEBUG, "DBG: sending %s submit RPC call: %s", pool->stratum_url, s);