Browse Source

Remove last reference to struct work used outside the sshare_lock in submit_work_thread

nfactor-troky
Con Kolivas 12 years ago
parent
commit
7551b88d00
  1. 5
      cgminer.c

5
cgminer.c

@ -3149,7 +3149,7 @@ static void *submit_work_thread(void *userdata) @@ -3149,7 +3149,7 @@ static void *submit_work_thread(void *userdata)
if (work->stratum) {
struct stratum_share *sshare = calloc(sizeof(struct stratum_share), 1);
uint32_t *hash32 = (uint32_t *)work->hash, nonce;
uint32_t *hash32 = (uint32_t *)work->hash, h32, nonce;
char *noncehex;
char s[1024];
@ -3165,10 +3165,11 @@ static void *submit_work_thread(void *userdata) @@ -3165,10 +3165,11 @@ static void *submit_work_thread(void *userdata)
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, sshare->id);
h32 = hash32[6];
mutex_unlock(&sshare_lock);
free(noncehex);
applog(LOG_INFO, "Submitting share %08lx to pool %d", (unsigned long)(hash32[6]), pool->pool_no);
applog(LOG_INFO, "Submitting share %08lx to pool %d", h32, pool->pool_no);
if (likely(stratum_send(pool, s, strlen(s)))) {
if (pool_tclear(pool, &pool->submit_fail))

Loading…
Cancel
Save