|
|
@ -5450,9 +5450,13 @@ static void *stratum_sthread(void *userdata) |
|
|
|
while (time(NULL) < sshare->sshare_time + 120) { |
|
|
|
while (time(NULL) < sshare->sshare_time + 120) { |
|
|
|
bool sessionid_match; |
|
|
|
bool sessionid_match; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mutex_lock(&sshare_lock); |
|
|
|
if (likely(stratum_send(pool, s, strlen(s)))) { |
|
|
|
if (likely(stratum_send(pool, s, strlen(s)))) { |
|
|
|
int ssdiff; |
|
|
|
int ssdiff; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (pool_tclear(pool, &pool->submit_fail)) |
|
|
|
|
|
|
|
applog(LOG_WARNING, "%s communication resumed, submitting work", get_pool_name(pool)); |
|
|
|
|
|
|
|
|
|
|
|
sshare->sshare_sent = time(NULL); |
|
|
|
sshare->sshare_sent = time(NULL); |
|
|
|
ssdiff = sshare->sshare_sent - sshare->sshare_time; |
|
|
|
ssdiff = sshare->sshare_sent - sshare->sshare_time; |
|
|
|
if (opt_debug || ssdiff > 0) { |
|
|
|
if (opt_debug || ssdiff > 0) { |
|
|
@ -5460,18 +5464,17 @@ static void *stratum_sthread(void *userdata) |
|
|
|
pool->pool_no, ssdiff); |
|
|
|
pool->pool_no, ssdiff); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
mutex_lock(&sshare_lock); |
|
|
|
|
|
|
|
HASH_ADD_INT(stratum_shares, id, sshare); |
|
|
|
HASH_ADD_INT(stratum_shares, id, sshare); |
|
|
|
pool->sshares++; |
|
|
|
pool->sshares++; |
|
|
|
mutex_unlock(&sshare_lock); |
|
|
|
mutex_unlock(&sshare_lock); |
|
|
|
|
|
|
|
|
|
|
|
if (pool_tclear(pool, &pool->submit_fail)) |
|
|
|
|
|
|
|
applog(LOG_WARNING, "%s communication resumed, submitting work", get_pool_name(pool)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
applog(LOG_DEBUG, "Successfully submitted, adding to stratum_shares db"); |
|
|
|
applog(LOG_DEBUG, "Successfully submitted, adding to stratum_shares db"); |
|
|
|
submitted = true; |
|
|
|
submitted = true; |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
mutex_unlock(&sshare_lock); |
|
|
|
|
|
|
|
} |
|
|
|
if (!pool_tset(pool, &pool->submit_fail) && cnx_needed(pool)) { |
|
|
|
if (!pool_tset(pool, &pool->submit_fail) && cnx_needed(pool)) { |
|
|
|
applog(LOG_WARNING, "%s stratum share submission failure", get_pool_name(pool)); |
|
|
|
applog(LOG_WARNING, "%s stratum share submission failure", get_pool_name(pool)); |
|
|
|
total_ro++; |
|
|
|
total_ro++; |
|
|
|