Commit 21a23a45d7b2ba325db6606bf554c7e0afd6e1f0

ckolivas 2012-06-27T10:15:57

Work around pools that advertise very low expire= time inappropriately as this leads to many false positives for stale shares detected.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/cgminer.c b/cgminer.c
index 69181b0..613b406 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -2167,7 +2167,10 @@ static bool stale_work(struct work *work, bool share)
 		return false;
 
 	if (share) {
-		if (work->rolltime)
+		/* Technically the rolltime should be correct but some pools
+		 * advertise a broken expire= that is lower than a meaningful
+		 * scantime */
+		if (work->rolltime > opt_scantime)
 			work_expiry = work->rolltime;
 		else
 			work_expiry = opt_expiry;