Commit b60f9da4a540853885fcd8753feb0a9d07552631

Con Kolivas 2012-08-16T17:24:04

Simplify the enough work algorithm dramatically.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/cgminer.c b/cgminer.c
index e6a694b..548de74 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -2408,9 +2408,13 @@ static void *get_work_thread(void *userdata)
 	ts = __total_staged();
 	mutex_unlock(stgd_lock);
 
-	if (((cs >= opt_queue || cq >= opt_queue) && ts >= maxq) ||
-	    ((cs >= opt_queue || cq >= opt_queue) && tq >= maxq && ((cq < maxq && !opt_fail_only) || opt_fail_only)) ||
-	    clone_available())
+	if (ts >= maxq)
+		goto out;
+
+	if (ts >= opt_queue && tq >= maxq)
+		goto out;
+
+	if (clone_available())
 		goto out;
 
 	ret_work = make_work();