Work around pools that advertise very low expire= time inappropriately as this leads to many false positives for stale shares detected.
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;