Browse Source

Clear last pool work on switching pools if the current pool supports local work generation or we are in failover only mode.

Con Kolivas 13 years ago
parent
commit
016f065f69
1 changed files with 6 additions and 1 deletions
  1. 6 1
      cgminer.c

+ 6 - 1
cgminer.c

@@ -3343,6 +3343,8 @@ static struct pool *priority_pool(int choice)
 	return ret;
 }
 
+static void clear_pool_work(struct pool *pool);
+
 void switch_pools(struct pool *selected)
 {
 	struct pool *pool, *last_pool;
@@ -3411,8 +3413,11 @@ void switch_pools(struct pool *selected)
 	if (opt_fail_only)
 		pool_tset(pool, &pool->lagging);
 
-	if (pool != last_pool && pool_strategy != POOL_LOADBALANCE && pool_strategy != POOL_BALANCE)
+	if (pool != last_pool && pool_strategy != POOL_LOADBALANCE && pool_strategy != POOL_BALANCE) {
 		applog(LOG_WARNING, "Switching to %s", pool->rpc_url);
+		if (pool->has_gbt || pool->has_stratum || opt_fail_only)
+			clear_pool_work(last_pool);
+	}
 
 	mutex_lock(&lp_lock);
 	pthread_cond_broadcast(&lp_cond);