Commit 3d1e9f5098cd1a3f9c6df54f819d91b39b56f4f7

Con Kolivas 2012-12-08T21:32:49

Set pool lagging message for getwork pool that falls to zero staged in getwork thread.

diff --git a/cgminer.c b/cgminer.c
index 9f84b67..7398c73 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -3083,6 +3083,11 @@ static void *getwork_thread(void __maybe_unused *userdata)
 
 		work = make_work();
 
+		if (lagging && !pool_tset(cp, &cp->lagging)) {
+			applog(LOG_WARNING, "Pool %d not providing work fast enough", cp->pool_no);
+			cp->getfail_occasions++;
+			total_go++;
+		}
 		pool = select_pool(lagging);
 retry:
 		if (pool->has_stratum) {
@@ -3144,6 +3149,7 @@ retry:
 			pool = select_pool(true);
 			goto retry;
 		}
+		pool_tclear(pool, &pool->lagging);
 		applog(LOG_DEBUG, "Generated getwork work");
 		stage_work(work);
 		push_curl_entry(ce, pool);