Browse Source

zr5: disable some of the stratum stale work checks

master
Tanguy Pruvot 9 years ago
parent
commit
7c25f6dc0a
  1. 6
      ccminer.cpp
  2. 2
      zr5.cu

6
ccminer.cpp

@ -600,10 +600,10 @@ static bool submit_upstream_work(CURL *curl, struct work *work)
/* discard if a newer bloc was received */ /* discard if a newer bloc was received */
stale_work = work->height && work->height < g_work.height; stale_work = work->height && work->height < g_work.height;
if (have_stratum && !stale_work) { if (have_stratum && !stale_work && opt_algo != ALGO_ZR5) {
pthread_mutex_lock(&g_work_lock); pthread_mutex_lock(&g_work_lock);
if (strlen(work->job_id + 8)) if (strlen(work->job_id + 8))
stale_work = strcmp(work->job_id + 8, g_work.job_id + 8); stale_work = strncmp(work->job_id + 8, g_work.job_id + 8, 4);
pthread_mutex_unlock(&g_work_lock); pthread_mutex_unlock(&g_work_lock);
} }
@ -618,7 +618,7 @@ static bool submit_upstream_work(CURL *curl, struct work *work)
} }
} }
if (opt_algo == ALGO_ZR5 && !stale_work) { if (!stale_work && opt_algo == ALGO_ZR5 && !have_stratum) {
stale_work = (memcmp(&work->data[1], &g_work.data[1], 68)); stale_work = (memcmp(&work->data[1], &g_work.data[1], 68));
} }

2
zr5.cu

@ -313,7 +313,7 @@ extern "C" int scanhash_zr5(int thr_id, uint32_t *pdata, const uint32_t *ptarget
zr5hash(vhash64, pdata); zr5hash(vhash64, pdata);
if (vhash64[7] <= ptarget[7] && fulltest(vhash64, ptarget)) { if (vhash64[7] <= ptarget[7] && fulltest(vhash64, ptarget)) {
int res = 1; int res = 1;
uint32_t secNonce = cuda_check_hash_suppl(thr_id, throughput, pdata[19], d_hash[thr_id], 1); uint32_t secNonce = cuda_check_hash_suppl(thr_id, throughput, oldp19, d_hash[thr_id], 1);
if (secNonce != 0) { if (secNonce != 0) {
offset = secNonce - oldp19; offset = secNonce - oldp19;
pok = version | (0x10000UL * h_poks[thr_id][offset]); pok = version | (0x10000UL * h_poks[thr_id][offset]);

Loading…
Cancel
Save