mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-11 07:17:58 +00:00
Add the getwork delay time instead of subtracting it when determining if a share is stale.
This commit is contained in:
parent
b5757d124b
commit
ded16838db
@ -2159,6 +2159,7 @@ static bool stale_work(struct work *work, bool share)
|
||||
struct timeval now;
|
||||
time_t work_expiry;
|
||||
struct pool *pool;
|
||||
int getwork_delay;
|
||||
|
||||
if (work->mandatory)
|
||||
return false;
|
||||
@ -2172,13 +2173,13 @@ static bool stale_work(struct work *work, bool share)
|
||||
pool = work->pool;
|
||||
/* 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;
|
||||
if (!share) {
|
||||
int getwork_delay = pool->cgminer_pool_stats.getwork_wait_rolling * 5 + 1;
|
||||
|
||||
work_expiry -= getwork_delay;
|
||||
if (unlikely(work_expiry < 5))
|
||||
work_expiry = 5;
|
||||
}
|
||||
} else
|
||||
work_expiry += getwork_delay;
|
||||
|
||||
gettimeofday(&now, NULL);
|
||||
if ((now.tv_sec - work->tv_staged.tv_sec) >= work_expiry)
|
||||
|
Loading…
Reference in New Issue
Block a user