mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-11 15:27:53 +00:00
Stick to rolling only work from the current pool unless we're in load balance mode or lagging to avoid aggressive rolling imitating load balancing.
This commit is contained in:
parent
01aadda25c
commit
232408050c
14
main.c
14
main.c
@ -2421,6 +2421,18 @@ static void flush_requests(void)
|
||||
}
|
||||
}
|
||||
|
||||
static inline bool should_roll(struct work *work)
|
||||
{
|
||||
int rs;
|
||||
|
||||
rs = real_staged();
|
||||
if (rs >= opt_queue + mining_threads)
|
||||
return false;
|
||||
if (work->pool == current_pool() || pool_strategy == POOL_LOADBALANCE || !rs)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline bool can_roll(struct work *work)
|
||||
{
|
||||
return (work->pool && !stale_work(work, true) && work->rolltime &&
|
||||
@ -2462,7 +2474,7 @@ static bool divide_work(struct timeval *now, struct work *work, uint32_t hash_di
|
||||
if (opt_debug)
|
||||
applog(LOG_DEBUG, "Successfully divided work");
|
||||
return true;
|
||||
} else if (can_roll(work)) {
|
||||
} else if (can_roll(work) && should_roll(work)) {
|
||||
roll_work(work);
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user