Commit d6a6d70f4bd0cd6d7e6d6677e6f6a49be9f7fe98

Con Kolivas 2012-07-05T00:18:58

Set work blk nonce after work is queued to prevent duplicates.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/driver-bitforce.c b/driver-bitforce.c
index f42faa3..68fe265 100644
--- a/driver-bitforce.c
+++ b/driver-bitforce.c
@@ -298,6 +298,7 @@ re_send:
 		sprintf((char *)ob + 8 + 32 + 12 + 8, ">>>>>>>>");
 		BFwrite(fdDev, ob, 68);
 	}
+	work->blk.nonce = bitforce->end_nonce;
 
 	BFgets(pdevbuf, sizeof(pdevbuf), fdDev);
 	mutex_unlock(&bitforce->device_mutex);
@@ -368,7 +369,6 @@ static uint64_t bitforce_get_result(struct thr_info *thr, struct work *work)
 	}
 
 	applog(LOG_DEBUG, "BFL%i: waited %dms until %s", bitforce->device_id, bitforce->wait_ms, pdevbuf);
-	work->blk.nonce = bitforce->end_nonce;
 	if (pdevbuf[2] == '-') 
 		return bitforce->end_nonce;   /* No valid nonce found */
 	else if (pdevbuf[0] == 'I')