Commit 14e169b29f57e428c26ba99e6f485319f5acf531

Con Kolivas 2012-11-24T12:41:35

Add an extra slot in the max backlog for ztex to minimise dupes.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/driver-ztex.c b/driver-ztex.c
index 0aeca44..892009a 100644
--- a/driver-ztex.c
+++ b/driver-ztex.c
@@ -228,8 +228,9 @@ static int64_t ztex_scanhash(struct thr_info *thr, struct work *work,
 		return -1;
 	}
 	memset(lastnonce, 0, sizeof(uint32_t)*ztex->numNonces);
-	
-	backlog_max = ztex->numNonces * (1 + ztex->extraSolutions);
+
+	/* Add an extra slot for detecting dupes that lie around */
+	backlog_max = ztex->numNonces * (2 + ztex->extraSolutions);
 	backlog = malloc(sizeof(uint32_t) * backlog_max);
 	if (backlog == NULL) {
 		applog(LOG_ERR, "%s: failed to allocate backlog[%d]", ztex->repr, backlog_max);