|
|
@ -2159,7 +2159,6 @@ static bool stale_work(struct work *work, bool share) |
|
|
|
struct timeval now; |
|
|
|
struct timeval now; |
|
|
|
time_t work_expiry; |
|
|
|
time_t work_expiry; |
|
|
|
struct pool *pool; |
|
|
|
struct pool *pool; |
|
|
|
int getwork_delay; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (work->mandatory) |
|
|
|
if (work->mandatory) |
|
|
|
return false; |
|
|
|
return false; |
|
|
@ -2173,10 +2172,13 @@ static bool stale_work(struct work *work, bool share) |
|
|
|
pool = work->pool; |
|
|
|
pool = work->pool; |
|
|
|
/* Factor in the average getwork delay of this pool, rounding it up to
|
|
|
|
/* Factor in the average getwork delay of this pool, rounding it up to
|
|
|
|
* the nearest second */ |
|
|
|
* the nearest second */ |
|
|
|
getwork_delay = pool->cgminer_pool_stats.getwork_wait_rolling * 5 + 1; |
|
|
|
if (!share) { |
|
|
|
work_expiry -= getwork_delay; |
|
|
|
int getwork_delay = pool->cgminer_pool_stats.getwork_wait_rolling * 5 + 1; |
|
|
|
if (unlikely(work_expiry < 5)) |
|
|
|
|
|
|
|
work_expiry = 5; |
|
|
|
work_expiry -= getwork_delay; |
|
|
|
|
|
|
|
if (unlikely(work_expiry < 5)) |
|
|
|
|
|
|
|
work_expiry = 5; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
gettimeofday(&now, NULL); |
|
|
|
gettimeofday(&now, NULL); |
|
|
|
if ((now.tv_sec - work->tv_staged.tv_sec) >= work_expiry) |
|
|
|
if ((now.tv_sec - work->tv_staged.tv_sec) >= work_expiry) |
|
|
|