Commit b4ba9c3f00609301afde4e735233ef932b496864

Luke Dashjr 2012-04-21T19:55:11

Bugfix: Icarus: Invalidate old job, even if no nonce found in it

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/driver-icarus.c b/driver-icarus.c
index e6f9ebc..8601511 100644
--- a/driver-icarus.c
+++ b/driver-icarus.c
@@ -294,6 +294,8 @@ static uint64_t icarus_scanhash(struct thr_info *thr, struct work *work,
 
 	memcpy((char *)&nonce, nonce_bin, sizeof(nonce_bin));
 
+	work->blk.nonce = 0xffffffff;
+
 	if (nonce == 0 && ret) {
 		if (unlikely(diff.tv_sec > 12 || (diff.tv_sec == 11 && diff.tv_usec > 300067)))
 			return 0xffffffff;
@@ -306,7 +308,6 @@ static uint64_t icarus_scanhash(struct thr_info *thr, struct work *work,
 #ifndef __BIG_ENDIAN__
 	nonce = swab32(nonce);
 #endif
-	work->blk.nonce = 0xffffffff;
 	submit_nonce(thr, work, nonce);
 
 	hash_count = (nonce & 0x7fffffff);