Commit 4a210d4eff61b710d95d0e4a7f95f89ae9d04858

Con Kolivas 2012-08-27T10:02:53

Only clear the pool lagging flag if we're staging work faster than we're using it.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/cgminer.c b/cgminer.c
index e56e592..0f88272 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -4085,7 +4085,10 @@ retry:
 	pool = work_heap->pool;
 	/* If we make it here we have succeeded in getting fresh work */
 	if (!work_heap->mined) {
-		pool_tclear(pool, &pool->lagging);
+		/* Only clear the lagging flag if we are staging them at a
+		 * rate faster then we're using them */
+		if (pool->lagging && total_staged())
+			pool_tclear(pool, &pool->lagging);
 		if (pool_tclear(pool, &pool->idle))
 			pool_resus(pool);
 	}