Commit f9308f8fcab5f2008a2e08cc2e2eee230a5995ff

Con Kolivas 2011-10-09T13:21:06

Disable work division for CPU mining which can lead to repeated work being performed.

diff --git a/main.c b/main.c
index f47dd68..2d0b9ae 100644
--- a/main.c
+++ b/main.c
@@ -3839,6 +3839,13 @@ static void roll_work(struct work *work)
  * recycled more rapidly and discard the clone to avoid repeating work */
 static bool divide_work(struct timeval *now, struct work *work, uint32_t hash_div)
 {
+	if (can_roll(work) && should_roll(work)) {
+		roll_work(work);
+		return true;
+	}
+	return false;
+#if 0
+	/* Work division is disabled because it can lead to repeated work */
 	uint64_t hash_inc;
 
 	if (work->clone)
@@ -3858,6 +3865,7 @@ static bool divide_work(struct timeval *now, struct work *work, uint32_t hash_di
 		return true;
 	}
 	return false;
+#endif
 }
 
 static bool get_work(struct work *work, bool requested, struct thr_info *thr,