Commit 12553004c5504c3d7e5d61498fa00d51e7e4b44e

Con Kolivas 2013-03-07T14:40:48

Do not continue work from a stratum pool where the connection has been interrupted.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/cgminer.c b/cgminer.c
index 6557d82..61c5208 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -3135,8 +3135,14 @@ static bool stale_work(struct work *work, bool share)
 	pool = work->pool;
 
 	if (!share && pool->has_stratum) {
-		bool same_job = true;
+		bool same_job;
 
+		if (!pool->stratum_active || !pool->stratum_notify) {
+			applog(LOG_DEBUG, "Work stale due to stratum inactive");
+			return true;
+		}
+
+		same_job = true;
 		mutex_lock(&pool->pool_lock);
 		if (strcmp(work->job_id, pool->swork.job_id))
 			same_job = false;