Commit 2b6e3676cd6e056615aaf3207fdcbf42117f9b98

Con Kolivas 2012-10-08T22:10:15

Count an invalid nonce count as a hardware error on opencl.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/findnonce.c b/findnonce.c
index 344c7d1..2bfc1ef 100644
--- a/findnonce.c
+++ b/findnonce.c
@@ -254,7 +254,14 @@ static void *postcalc_hash(void *userdata)
 
 	/* To prevent corrupt values in FOUND from trying to read beyond the
 	 * end of the res[] array */
-	pcd->res[FOUND] &= FOUND;
+	if (unlikely(pcd->res[FOUND] & ~FOUND)) {
+		applog(LOG_WARNING, "%s%d: invalid nonce count - HW error",
+				thr->cgpu->api->name, thr->cgpu->device_id);
+		hw_errors++;
+		thr->cgpu->hw_errors++;
+		pcd->res[FOUND] &= FOUND;
+	}
+
 	for (entry = 0; entry < pcd->res[FOUND]; entry++) {
 		uint32_t nonce = pcd->res[entry];