Commit 2f3a4a47c8d471b9050efab55bf983d043ad737b

Con Kolivas 2012-02-21T21:56:30

Reset the longpoll flag after it's been used once to prevent it restarting work again.

diff --git a/cgminer.c b/cgminer.c
index 74ba5f8..4ea1962 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -2130,14 +2130,16 @@ static void test_work_current(struct work *work)
 
 		work_block++;
 
-		if (work->longpoll)
+		if (work->longpoll) {
 			applog(LOG_NOTICE, "LONGPOLL detected new block on network, waiting on fresh work");
-		else if (have_longpoll)
+			work->longpoll = false;
+		} else if (have_longpoll)
 			applog(LOG_NOTICE, "New block detected on network before longpoll, waiting on fresh work");
 		else
 			applog(LOG_NOTICE, "New block detected on network, waiting on fresh work");
 		restart_threads();
 	} else if (work->longpoll) {
+		work->longpoll = false;
 		applog(LOG_NOTICE, "LONGPOLL requested work restart, waiting on fresh work");
 		work_block++;
 		restart_threads();