From 7551b88d005d3ac2826986f585711f1303b0d163 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Fri, 15 Feb 2013 16:09:36 +1100 Subject: [PATCH] Remove last reference to struct work used outside the sshare_lock in submit_work_thread --- cgminer.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cgminer.c b/cgminer.c index 37c46bbb..bec123f3 100644 --- a/cgminer.c +++ b/cgminer.c @@ -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) 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))