mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-22 20:44:19 +00:00
Check the job_id has not changed on stratum work when deciding if the work is stale as might occur across disconnections.
This commit is contained in:
parent
fcb265322d
commit
5c4c2d6786
14
cgminer.c
14
cgminer.c
@ -3184,6 +3184,20 @@ static bool stale_work(struct work *work, bool share)
|
||||
work_expiry = opt_expiry;
|
||||
|
||||
pool = work->pool;
|
||||
|
||||
if (pool->has_stratum) {
|
||||
bool same_job = true;
|
||||
|
||||
mutex_lock(&pool->pool_lock);
|
||||
if (strcmp(work->job_id, pool->swork.job_id))
|
||||
same_job = false;
|
||||
mutex_unlock(&pool->pool_lock);
|
||||
if (!same_job) {
|
||||
applog(LOG_DEBUG, "Work stale due to stratum job_id mismatch");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/* Factor in the average getwork delay of this pool, rounding it up to
|
||||
* the nearest second */
|
||||
getwork_delay = pool->cgminer_pool_stats.getwork_wait_rolling * 5 + 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user