1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-11 15:27:53 +00:00

Cope with pools being removed in the stratum thread.

This commit is contained in:
Con Kolivas 2012-09-29 00:23:27 +10:00
parent 0f1f2a62a6
commit 04551445f6

View File

@ -3978,9 +3978,13 @@ static void *stratum_thread(void *userdata)
pool->stratum_active = pool->stratum_auth = false;
applog(LOG_WARNING, "Stratum connection to pool %d interrupted", pool->pool_no);
pool->getfail_occasions++;
if (!initiate_stratum(pool) || !auth_stratum(pool)) {
pool_died(pool);
break;
total_go++;
while (!initiate_stratum(pool) || !auth_stratum(pool)) {
if (!pool->idle)
pool_died(pool);
if (pool->removed)
goto out;
sleep(5);
}
}
s = recv_line(pool->sock);
@ -3989,8 +3993,14 @@ static void *stratum_thread(void *userdata)
if (!parse_stratum(pool, s)) /* Create message queues here */
applog(LOG_INFO, "Unknown stratum msg: %s", s);
free(s);
if (unlikely(pool->removed)) {
CLOSESOCKET(pool->sock);
goto out;
}
}
out:
return NULL;
}