Browse Source

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.

nfactor-troky
Con Kolivas 13 years ago
parent
commit
232408050c
  1. 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) static inline bool can_roll(struct work *work)
{ {
return (work->pool && !stale_work(work, true) && work->rolltime && 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) if (opt_debug)
applog(LOG_DEBUG, "Successfully divided work"); applog(LOG_DEBUG, "Successfully divided work");
return true; return true;
} else if (can_roll(work)) { } else if (can_roll(work) && should_roll(work)) {
roll_work(work); roll_work(work);
return true; return true;
} }

Loading…
Cancel
Save