Commit eddd02fea17c6d96ff272f739e1b70e3530e81f0

Con Kolivas 2012-06-27T23:32:50

Put upper bounds to under 2 hours that work can be rolled into the future for bitcoind will deem it invalid beyond that.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
diff --git a/cgminer.c b/cgminer.c
index 756e005..457990d 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -3644,9 +3644,12 @@ static inline bool should_roll(struct work *work)
 	return false;
 }
 
+/* Limit rolls to 7000 to not beyond 2 hours in the future where bitcoind will
+ * reject blocks as invalid. */
 static inline bool can_roll(struct work *work)
 {
-	return (work->pool && !stale_work(work, false) && work->rolltime && !work->clone);
+	return (work->pool && work->rolltime && !work->clone &&
+		work->rolls < 7000 && !stale_work(work, false));
 }
 
 static void roll_work(struct work *work)