mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-10 23:08:07 +00:00
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.
This commit is contained in:
parent
b6ac9f185e
commit
1c070475c3
28
findnonce.c
28
findnonce.c
@ -152,19 +152,17 @@ static void *postcalc_hash(void *userdata)
|
||||
struct thr_info *thr = pcd->thr;
|
||||
dev_blk_ctx *blk = &pcd->work->blk;
|
||||
struct work *work = pcd->work;
|
||||
uint32_t start = 0;
|
||||
|
||||
cl_uint A, B, C, D, E, F, G, H;
|
||||
cl_uint W[16];
|
||||
cl_uint nonce;
|
||||
cl_uint best_g;
|
||||
uint32_t end;
|
||||
cl_uint nonce = 0;
|
||||
int entry = 0;
|
||||
|
||||
pthread_detach(pthread_self());
|
||||
cycle:
|
||||
while (entry < MAXBUFFERS) {
|
||||
if (pcd->res[entry]) {
|
||||
start = pcd->res[entry++];
|
||||
nonce = pcd->res[entry++];
|
||||
break;
|
||||
}
|
||||
entry++;
|
||||
@ -172,10 +170,6 @@ cycle:
|
||||
if (entry == MAXBUFFERS)
|
||||
goto out;
|
||||
|
||||
best_g = ~0;
|
||||
end = start + 1026;
|
||||
|
||||
for (nonce = start; nonce != end; nonce+=1) {
|
||||
A = blk->cty_a; B = blk->cty_b;
|
||||
C = blk->cty_c; D = blk->cty_d;
|
||||
E = blk->cty_e; F = blk->cty_f;
|
||||
@ -205,21 +199,12 @@ cycle:
|
||||
FR(32); FR(40);
|
||||
FR(48); PFR(56);
|
||||
|
||||
if (unlikely(H == 0xA41F32E7)) {
|
||||
if (likely(H == 0xA41F32E7)) {
|
||||
if (unlikely(submit_nonce(thr, work, nonce) == false)) {
|
||||
applog(LOG_ERR, "Failed to submit work, exiting");
|
||||
break;
|
||||
goto out;
|
||||
}
|
||||
|
||||
G += 0x1f83d9ab;
|
||||
G = ByteReverse(G);
|
||||
|
||||
if (G < best_g)
|
||||
best_g = G;
|
||||
}
|
||||
}
|
||||
|
||||
if (unlikely(best_g == ~0)) {
|
||||
} else {
|
||||
if (opt_debug)
|
||||
applog(LOG_DEBUG, "No best_g found! Error in OpenCL code?");
|
||||
hw_errors++;
|
||||
@ -228,7 +213,6 @@ cycle:
|
||||
if (entry < MAXBUFFERS)
|
||||
goto cycle;
|
||||
out:
|
||||
pthread_detach(pthread_self());
|
||||
free(pcd);
|
||||
return NULL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user