|
August 26, 2012, 07:21:13 PM |
|
I don't see anything except nonce is incremented in this code. (CPU miner)
bool scanhash_c(int thr_id, const unsigned char *midstate, unsigned char *data, unsigned char *hash, const unsigned char *target, uint32_t max_nonce, unsigned long *hashes_done) { uint32_t *hash32 = (uint32_t *) hash; uint32_t *nonce = (uint32_t *)(data + 12); uint32_t n = 0; unsigned long stat_ctr = 0;
work_restart[thr_id].restart = 0;
while (1) { unsigned char hash1[32];
n++; *nonce = n;
runhash(hash1, data, midstate); runhash(hash, hash1, sha256_init_state);
stat_ctr++;
if (unlikely((hash32[7] == 0) && fulltest(hash, target))) { *hashes_done = stat_ctr; return true; }
if ((n >= max_nonce) || work_restart[thr_id].restart) { *hashes_done = stat_ctr; return false; } } }
|