Browse Source

Simplify the enough work algorithm dramatically.

Con Kolivas 13 years ago
parent
commit
b60f9da4a5
1 changed files with 7 additions and 3 deletions
  1. 7 3
      cgminer.c

+ 7 - 3
cgminer.c

@@ -2408,9 +2408,13 @@ static void *get_work_thread(void *userdata)
 	ts = __total_staged();
 	ts = __total_staged();
 	mutex_unlock(stgd_lock);
 	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;
 		goto out;
 
 
 	ret_work = make_work();
 	ret_work = make_work();