Browse Source

Only continue submitting shares with mining.resume support on stratum when the session id matches.

nfactor-troky
Con Kolivas 12 years ago
parent
commit
0f7ab3670c
  1. 8
      cgminer.c

8
cgminer.c

@ -3173,7 +3173,7 @@ static void *submit_work_thread(void *userdata)
* once and the stratum pool supports sessionid for mining * once and the stratum pool supports sessionid for mining
* resume. */ * resume. */
while (time(NULL) < sshare->sshare_time + 120) { while (time(NULL) < sshare->sshare_time + 120) {
bool has_sessionid; bool sessionid_match;
if (likely(stratum_send(pool, s, strlen(s)))) { if (likely(stratum_send(pool, s, strlen(s)))) {
if (pool_tclear(pool, &pool->submit_fail)) if (pool_tclear(pool, &pool->submit_fail))
@ -3192,11 +3192,11 @@ static void *submit_work_thread(void *userdata)
} }
mutex_lock(&pool->pool_lock); mutex_lock(&pool->pool_lock);
has_sessionid = pool->sessionid != NULL; sessionid_match = pool->sessionid && work->sessionid && !strcmp(pool->sessionid, work->sessionid);
mutex_unlock(&pool->pool_lock); mutex_unlock(&pool->pool_lock);
if (!has_sessionid) { if (!sessionid_match) {
applog(LOG_DEBUG, "No session id for resubmitting stratum share"); applog(LOG_DEBUG, "No matching session id for resubmitting stratum share");
break; break;
} }
/* Retry every 5 seconds */ /* Retry every 5 seconds */

Loading…
Cancel
Save