Browse Source

Bugfix: Ignore last work time if pool is known to be down

Luke Dashjr 12 years ago
parent
commit
8de42fc839
1 changed files with 6 additions and 2 deletions
  1. 6 2
      miner.c

+ 6 - 2
miner.c

@@ -8003,10 +8003,14 @@ static bool pool_active(struct pool *pool, bool pinging)
 		return pool->stratum_active;
 		return pool->stratum_active;
 	
 	
 	timer_set_now(&tv_now);
 	timer_set_now(&tv_now);
+	if (pool->idle)
+	{
+		if (timer_elapsed(&pool->tv_idle, &tv_now) < 30)
+			return false;
+	}
+	else
 	if (timer_isset(&pool->tv_last_work_time) && timer_elapsed(&pool->tv_last_work_time, &tv_now) < 60)
 	if (timer_isset(&pool->tv_last_work_time) && timer_elapsed(&pool->tv_last_work_time, &tv_now) < 60)
 		return true;
 		return true;
-	if (pool->idle && timer_elapsed(&pool->tv_idle, &tv_now) < 30)
-		return false;
 	
 	
 		applog(LOG_INFO, "Testing pool %s", pool->rpc_url);
 		applog(LOG_INFO, "Testing pool %s", pool->rpc_url);