From 88983306fdc56b4ead41a9fdfa045f46b91282e1 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Sun, 18 Nov 2012 15:50:04 +1100 Subject: [PATCH] Do not attempt to remove the stratum share hash after unsuccessful submission since it may already be removed by clear_stratum_shares. --- cgminer.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/cgminer.c b/cgminer.c index 3c83de1a..6694ac19 100644 --- a/cgminer.c +++ b/cgminer.c @@ -3233,20 +3233,10 @@ static void *submit_work_thread(void *userdata) if (pool_tclear(pool, &pool->submit_fail)) applog(LOG_WARNING, "Pool %d communication resumed, submitting work", pool->pool_no); applog(LOG_DEBUG, "Successfully submitted, adding to stratum_shares db"); - } else { - applog(LOG_WARNING, "Failed to submit stratum share to pool %d", pool->pool_no); - mutex_lock(&sshare_lock); - HASH_DEL(stratum_shares, sshare); - mutex_unlock(&sshare_lock); - free(sshare); - pool->stale_shares++; - total_stale++; - - if (!pool_tset(pool, &pool->submit_fail)) { - total_ro++; - pool->remotefail_occasions++; - applog(LOG_WARNING, "Pool %d share submission failure", pool->pool_no); - } + } else if (!pool_tset(pool, &pool->submit_fail)) { + applog(LOG_WARNING, "Pool %d stratum share submission failure", pool->pool_no); + total_ro++; + pool->remotefail_occasions++; } goto out;