Browse Source

Merge commit '26a8a8e' into cg_merges_20131023a

Luke Dashjr 12 years ago
parent
commit
ebdc4aa914
2 changed files with 13 additions and 2 deletions
  1. 5 0
      README
  2. 8 2
      miner.c

+ 5 - 0
README

@@ -505,6 +505,11 @@ looking, so if the quota is changed on the fly, it only affects future work.
 If all pools are set to zero quota or all pools with quota are dead, it will
 fall back to a failover mode. See quota below for more information.
 
+The failover-only flag has special meaning in combination with load-balance
+mode and it will distribute quota back to pool 0 from any pools that are
+unable to provide work for any reason so as to maintain quota ratios between
+the rest of the pools.
+
 BALANCE:
 This strategy monitors the amount of difficulty 1 shares solved for each pool
 and uses it to try to end up doing the same amount of work for all pools.

+ 8 - 2
miner.c

@@ -4020,8 +4020,14 @@ retry:
 		if (pool->quota_used++ >= pool->quota) {
 			pool->quota_used = 0;
 			pool = NULL;
-		} else if (!pool_unworkable(pool))
-			break;
+		} else {
+			if (!pool_unworkable(pool))
+				break;
+			/* Failover-only flag for load-balance means distribute
+			 * unused quota to pool 0. */
+			if (opt_fail_only)
+				pools[0]->quota++;
+		}
 		pool = NULL;
 		if (++rotating_pool >= total_pools)
 			rotating_pool = 0;