Commit e8daf1d8f2bdd58f3e81a3a25d5ba4390d2972d7

Con Kolivas 2012-08-20T12:45:07

Increment the queued count after the curl is popped in case there's a delay waiting on curls and we think we've queued work when in fact we're waiting on curls.

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 e8a3715..fbf1ebd 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -2415,11 +2415,15 @@ retry:
 		if (ts <= opt_queue)
 			lagging = true;
 		pool = ret_work->pool = select_pool(lagging);
-		inc_queued();
 
 		if (!ce)
 			ce = pop_curl_entry(pool);
 
+		/* Inc queued count after ce is popped in case there're none
+		 * left and we think we've queued work when we're just waiting
+		 * for curls */
+		inc_queued();
+
 		/* obtain new work from bitcoin via JSON-RPC */
 		if (!get_upstream_work(ret_work, ce->curl)) {
 			/* pause, then restart work-request loop */