Browse Source

Merge commit '54f1b80' into scrypt

Conflicts:
	miner.c
Luke Dashjr 13 years ago
parent
commit
26a90e671f
1 changed files with 3 additions and 2 deletions
  1. 3 2
      scrypt.c

+ 3 - 2
scrypt.c

@@ -434,19 +434,20 @@ bool scanhash_scrypt(struct thr_info *thr, const unsigned char *pmidstate, unsig
 		data[19] = n;
 		data[19] = n;
 		tmp_hash7 = scrypt_1024_1_1_256_sp(data, scratchbuf);
 		tmp_hash7 = scrypt_1024_1_1_256_sp(data, scratchbuf);
 
 
-		if (tmp_hash7 <= Htarg) {
+		if (unlikely(tmp_hash7 <= Htarg)) {
 			((uint32_t *)pdata)[19] = byteswap(n);
 			((uint32_t *)pdata)[19] = byteswap(n);
 			*last_nonce = n;
 			*last_nonce = n;
 			ret = true;
 			ret = true;
 			break;
 			break;
 		}
 		}
 
 
-		if ((n >= max_nonce) || thr->work_restart) {
+		if (unlikely((n >= max_nonce) || thr->work_restart)) {
 			*last_nonce = n;
 			*last_nonce = n;
 			break;
 			break;
 		}
 		}
 	}
 	}
 out_ret:
 out_ret:
+	free(scratchbuf);;
 	return ret;
 	return ret;
 }
 }