Use pool_unworkable in select_balanced as well.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
diff --git a/cgminer.c b/cgminer.c
index fcef695..c98cc31 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -2593,6 +2593,18 @@ out:
return rc;
}
+/* Specifies whether we can use this pool for work or not. */
+static bool pool_unworkable(struct pool *pool)
+{
+ if (pool->idle)
+ return true;
+ if (pool->enabled != POOL_ENABLED)
+ return true;
+ if (pool->has_stratum && !pool->stratum_active)
+ return true;
+ return false;
+}
+
/* In balanced mode, the amount of diff1 solutions per pool is monitored as a
* rolling average per 10 minutes and if pools start getting more, it biases
* away from them to distribute work evenly. The share count is reset to the
@@ -2606,7 +2618,7 @@ static struct pool *select_balanced(struct pool *cp)
for (i = 0; i < total_pools; i++) {
struct pool *pool = pools[i];
- if (pool->idle || pool->enabled != POOL_ENABLED)
+ if (pool_unworkable(pool))
continue;
if (pool->shares < lowest) {
lowest = pool->shares;
@@ -2618,18 +2630,6 @@ static struct pool *select_balanced(struct pool *cp)
return ret;
}
-/* Specifies whether we can use this pool for work or not. */
-static bool pool_unworkable(struct pool *pool)
-{
- if (pool->idle)
- return true;
- if (pool->enabled != POOL_ENABLED)
- return true;
- if (pool->has_stratum && !pool->stratum_active)
- return true;
- return false;
-}
-
/* Select any active pool in a rotating fashion when loadbalance is chosen */
static inline struct pool *select_pool(bool lagging)
{