|
@@ -5395,6 +5395,9 @@ static bool pool_unworkable(const struct pool * const pool)
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+static struct pool *priority_pool(int);
|
|
|
|
|
+static bool pool_unusable(struct pool *);
|
|
|
|
|
+
|
|
|
static
|
|
static
|
|
|
bool pool_actively_desired(const struct pool * const pool, const struct pool *cp)
|
|
bool pool_actively_desired(const struct pool * const pool, const struct pool *cp)
|
|
|
{
|
|
{
|
|
@@ -5404,7 +5407,23 @@ bool pool_actively_desired(const struct pool * const pool, const struct pool *cp
|
|
|
return true;
|
|
return true;
|
|
|
if (!cp)
|
|
if (!cp)
|
|
|
cp = current_pool();
|
|
cp = current_pool();
|
|
|
- return (pool == cp);
|
|
|
|
|
|
|
+ if (pool == cp)
|
|
|
|
|
+ return true;
|
|
|
|
|
+
|
|
|
|
|
+ // If we are the highest priority, workable pool for a given algorithm, we are needed
|
|
|
|
|
+ struct mining_algorithm * const malgo = pool->goal->malgo;
|
|
|
|
|
+ for (int i = 0; i < total_pools; ++i)
|
|
|
|
|
+ {
|
|
|
|
|
+ struct pool * const other_pool = priority_pool(i);
|
|
|
|
|
+ if (other_pool == pool)
|
|
|
|
|
+ return true;
|
|
|
|
|
+ if (pool_unusable(other_pool))
|
|
|
|
|
+ continue;
|
|
|
|
|
+ if (other_pool->goal->malgo == malgo)
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static
|
|
static
|
|
@@ -5469,8 +5488,6 @@ struct pool *select_balanced(struct pool *cp, struct mining_algorithm * const ma
|
|
|
return ret;
|
|
return ret;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-static struct pool *priority_pool(int choice);
|
|
|
|
|
-
|
|
|
|
|
static
|
|
static
|
|
|
struct pool *select_loadbalance(struct mining_algorithm * const malgo)
|
|
struct pool *select_loadbalance(struct mining_algorithm * const malgo)
|
|
|
{
|
|
{
|
|
@@ -5547,8 +5564,6 @@ out: ;
|
|
|
return pool;
|
|
return pool;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-static bool pool_unusable(struct pool *pool);
|
|
|
|
|
-
|
|
|
|
|
static
|
|
static
|
|
|
struct pool *select_failover(struct mining_algorithm * const malgo)
|
|
struct pool *select_failover(struct mining_algorithm * const malgo)
|
|
|
{
|
|
{
|