Browse Source

Cycling over 1026 nonces is a remnant of old code not relevant now and can just lead to repeat submission of the same block increasing rejects.

Remove it.
nfactor-troky
Con Kolivas 14 years ago
parent
commit
1c070475c3
  1. 28
      findnonce.c

28
findnonce.c

@ -152,19 +152,17 @@ static void *postcalc_hash(void *userdata)
struct thr_info *thr = pcd->thr; struct thr_info *thr = pcd->thr;
dev_blk_ctx *blk = &pcd->work->blk; dev_blk_ctx *blk = &pcd->work->blk;
struct work *work = pcd->work; struct work *work = pcd->work;
uint32_t start = 0;
cl_uint A, B, C, D, E, F, G, H; cl_uint A, B, C, D, E, F, G, H;
cl_uint W[16]; cl_uint W[16];
cl_uint nonce; cl_uint nonce = 0;
cl_uint best_g;
uint32_t end;
int entry = 0; int entry = 0;
pthread_detach(pthread_self());
cycle: cycle:
while (entry < MAXBUFFERS) { while (entry < MAXBUFFERS) {
if (pcd->res[entry]) { if (pcd->res[entry]) {
start = pcd->res[entry++]; nonce = pcd->res[entry++];
break; break;
} }
entry++; entry++;
@ -172,10 +170,6 @@ cycle:
if (entry == MAXBUFFERS) if (entry == MAXBUFFERS)
goto out; goto out;
best_g = ~0;
end = start + 1026;
for (nonce = start; nonce != end; nonce+=1) {
A = blk->cty_a; B = blk->cty_b; A = blk->cty_a; B = blk->cty_b;
C = blk->cty_c; D = blk->cty_d; C = blk->cty_c; D = blk->cty_d;
E = blk->cty_e; F = blk->cty_f; E = blk->cty_e; F = blk->cty_f;
@ -205,21 +199,12 @@ cycle:
FR(32); FR(40); FR(32); FR(40);
FR(48); PFR(56); FR(48); PFR(56);
if (unlikely(H == 0xA41F32E7)) { if (likely(H == 0xA41F32E7)) {
if (unlikely(submit_nonce(thr, work, nonce) == false)) { if (unlikely(submit_nonce(thr, work, nonce) == false)) {
applog(LOG_ERR, "Failed to submit work, exiting"); applog(LOG_ERR, "Failed to submit work, exiting");
break; goto out;
}
G += 0x1f83d9ab;
G = ByteReverse(G);
if (G < best_g)
best_g = G;
}
} }
} else {
if (unlikely(best_g == ~0)) {
if (opt_debug) if (opt_debug)
applog(LOG_DEBUG, "No best_g found! Error in OpenCL code?"); applog(LOG_DEBUG, "No best_g found! Error in OpenCL code?");
hw_errors++; hw_errors++;
@ -228,7 +213,6 @@ cycle:
if (entry < MAXBUFFERS) if (entry < MAXBUFFERS)
goto cycle; goto cycle;
out: out:
pthread_detach(pthread_self());
free(pcd); free(pcd);
return NULL; return NULL;
} }

Loading…
Cancel
Save