Browse Source

Revert "Make sure not to try and submit work for nonces higher than already submitted in current work item."

This reverts commit a2dd410e362116a12ac5609da77abb3a5ee1b736.

Incorrect fix. Missed real shares that are accepted.
Con Kolivas 14 years ago
parent
commit
b6ac9f185e
3 changed files with 9 additions and 10 deletions
  1. 9 8
      findnonce.c
  2. 0 1
      main.c
  3. 0 1
      miner.h

+ 9 - 8
findnonce.c

@@ -157,6 +157,7 @@ static void *postcalc_hash(void *userdata)
 	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;
+	cl_uint best_g;
 	uint32_t end;
 	uint32_t end;
 	int entry = 0;
 	int entry = 0;
 
 
@@ -171,6 +172,7 @@ cycle:
 	if (entry == MAXBUFFERS)
 	if (entry == MAXBUFFERS)
 		goto out;
 		goto out;
 
 
+	best_g = ~0;
 	end = start + 1026;
 	end = start + 1026;
 
 
 	for (nonce = start; nonce != end; nonce+=1) {
 	for (nonce = start; nonce != end; nonce+=1) {
@@ -204,21 +206,20 @@ cycle:
 		FR(48); PFR(56);
 		FR(48); PFR(56);
 
 
 		if (unlikely(H == 0xA41F32E7)) {
 		if (unlikely(H == 0xA41F32E7)) {
+			if (unlikely(submit_nonce(thr, work, nonce) == false)) {
+				applog(LOG_ERR, "Failed to submit work, exiting");
+				break;
+			}
 
 
 			G += 0x1f83d9ab;
 			G += 0x1f83d9ab;
 			G = ByteReverse(G);
 			G = ByteReverse(G);
 
 
-			if (G < thr->best_g) {
-				if (unlikely(submit_nonce(thr, work, nonce) == false)) {
-					applog(LOG_ERR, "Failed to submit work, exiting");
-					break;
-				}
-				thr->best_g = G;
-			}
+			if (G < best_g)
+				best_g = G;
 		}
 		}
 	}
 	}
 
 
-	if (unlikely(thr->best_g == ~0)) {
+	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++;

+ 0 - 1
main.c

@@ -1727,7 +1727,6 @@ static void *gpuminer_thread(void *userdata)
 					"gpu mining thread %d", mythr->id);
 					"gpu mining thread %d", mythr->id);
 				goto out;
 				goto out;
 			}
 			}
-			mythr->best_g = ~0;
 			mythr->cgpu->getworks++;
 			mythr->cgpu->getworks++;
 			work->thr_id = thr_id;
 			work->thr_id = thr_id;
 			requested = false;
 			requested = false;

+ 0 - 1
miner.h

@@ -145,7 +145,6 @@ struct thr_info {
 	struct thread_q	*q;
 	struct thread_q	*q;
 	struct cgpu_info *cgpu;
 	struct cgpu_info *cgpu;
 	struct timeval last;
 	struct timeval last;
-	cl_uint best_g;
 };
 };
 
 
 static inline uint32_t swab32(uint32_t v)
 static inline uint32_t swab32(uint32_t v)