Browse Source

Merge commit '3e8f74c' into cg_merges_20121214

Luke Dashjr 13 years ago
parent
commit
6826651448
1 changed files with 2 additions and 2 deletions
  1. 2 2
      driver-ztex.c

+ 2 - 2
driver-ztex.c

@@ -150,7 +150,7 @@ static bool ztex_checkNonce(struct libztex_device *ztex,
                             struct libztex_hash_data *hdata)
                             struct libztex_hash_data *hdata)
 {
 {
 	uint32_t *data32 = (uint32_t *)(work->data);
 	uint32_t *data32 = (uint32_t *)(work->data);
-	unsigned char swap[128];
+	unsigned char swap[80];
 	uint32_t *swap32 = (uint32_t *)swap;
 	uint32_t *swap32 = (uint32_t *)swap;
 	unsigned char hash1[32];
 	unsigned char hash1[32];
 	unsigned char hash2[32];
 	unsigned char hash2[32];
@@ -271,7 +271,7 @@ static int64_t ztex_scanhash(struct thr_info *thr, struct work *work,
 			nonce = le32toh(nonce);
 			nonce = le32toh(nonce);
 			if (nonce > noncecnt)
 			if (nonce > noncecnt)
 				noncecnt = nonce;
 				noncecnt = nonce;
-			if (((nonce & 0x7fffffff) >> 4) < ((lastnonce[i] & 0x7fffffff) >> 4)) {
+			if (((0xffffffff - nonce) < (nonce - lastnonce[i])) || nonce < lastnonce[i]) {
 				applog(LOG_DEBUG, "%s: overflow nonce=%0.8x lastnonce=%0.8x", ztex->repr, nonce, lastnonce[i]);
 				applog(LOG_DEBUG, "%s: overflow nonce=%0.8x lastnonce=%0.8x", ztex->repr, nonce, lastnonce[i]);
 				overflow = true;
 				overflow = true;
 			} else
 			} else