Browse Source

Bugfix: Stable pool recovery: Only care if the pool is enabled

Luke Dashjr 11 years ago
parent
commit
f2702fb6c8
1 changed files with 3 additions and 3 deletions
  1. 3 3
      miner.c

+ 3 - 3
miner.c

@@ -8548,7 +8548,7 @@ out:
 
 
 static void pool_resus(struct pool *pool)
 static void pool_resus(struct pool *pool)
 {
 {
-	if (pool_strategy == POOL_FAILOVER && pool->prio < cp_prio())
+	if (pool->enabled == POOL_ENABLED && pool_strategy == POOL_FAILOVER && pool->prio < cp_prio())
 		applog(LOG_WARNING, "Pool %d %s alive, testing stability", pool->pool_no, pool->rpc_url);
 		applog(LOG_WARNING, "Pool %d %s alive, testing stability", pool->pool_no, pool->rpc_url);
 	else
 	else
 		applog(LOG_INFO, "Pool %d %s alive", pool->pool_no, pool->rpc_url);
 		applog(LOG_INFO, "Pool %d %s alive", pool->pool_no, pool->rpc_url);
@@ -9702,8 +9702,8 @@ static void *watchpool_thread(void __maybe_unused *userdata)
 			/* Only switch pools if the failback pool has been
 			/* Only switch pools if the failback pool has been
 			 * alive for more than 5 minutes to prevent
 			 * alive for more than 5 minutes to prevent
 			 * intermittently failing pools from being used. */
 			 * intermittently failing pools from being used. */
-			if (!pool->idle && pool_strategy == POOL_FAILOVER && pool->prio < cp_prio() &&
-			    now.tv_sec - pool->tv_idle.tv_sec > 300) {
+			if (!pool->idle && pool->enabled == POOL_ENABLED && pool_strategy == POOL_FAILOVER && pool->prio < cp_prio() && now.tv_sec - pool->tv_idle.tv_sec > 300)
+			{
 				applog(LOG_WARNING, "Pool %d %s stable for 5 mins",
 				applog(LOG_WARNING, "Pool %d %s stable for 5 mins",
 				       pool->pool_no, pool->rpc_url);
 				       pool->pool_no, pool->rpc_url);
 				switch_pools(NULL);
 				switch_pools(NULL);