|
@@ -2166,6 +2166,8 @@ static bool stale_work(struct work *work, bool share)
|
|
|
if (work->mandatory)
|
|
if (work->mandatory)
|
|
|
return false;
|
|
return false;
|
|
|
|
|
|
|
|
|
|
+ pool = work->pool;
|
|
|
|
|
+
|
|
|
if (share) {
|
|
if (share) {
|
|
|
/* Technically the rolltime should be correct but some pools
|
|
/* Technically the rolltime should be correct but some pools
|
|
|
* advertise a broken expire= that is lower than a meaningful
|
|
* advertise a broken expire= that is lower than a meaningful
|
|
@@ -2180,9 +2182,7 @@ static bool stale_work(struct work *work, bool share)
|
|
|
work_expiry = (work->rolltime - opt_scantime) * 2 / 3 + opt_scantime;
|
|
work_expiry = (work->rolltime - opt_scantime) * 2 / 3 + opt_scantime;
|
|
|
else /* Shouldn't happen unless someone increases scantime */
|
|
else /* Shouldn't happen unless someone increases scantime */
|
|
|
work_expiry = opt_scantime;
|
|
work_expiry = opt_scantime;
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
- 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;
|
|
getwork_delay = pool->cgminer_pool_stats.getwork_wait_rolling * 5 + 1;
|
|
@@ -2190,6 +2190,8 @@ static bool stale_work(struct work *work, bool share)
|
|
|
if (unlikely(work_expiry < 5))
|
|
if (unlikely(work_expiry < 5))
|
|
|
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)
|
|
|
return true;
|
|
return true;
|