Commit 72777f1f38c71ea7efdf54676d4385f408d942fa

Con Kolivas 2012-07-05T09:30:53

Disable nonce range support in BFL when broken support is detected.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/driver-bitforce.c b/driver-bitforce.c
index 04afc05..f67bdcc 100644
--- a/driver-bitforce.c
+++ b/driver-bitforce.c
@@ -390,6 +390,12 @@ static uint64_t bitforce_get_result(struct thr_info *thr, struct work *work)
 #ifndef __BIG_ENDIAN__
 		nonce = swab32(nonce);
 #endif
+		if (unlikely(bitforce->nonce_range && (nonce >= work->blk.nonce ||
+			(work->blk.nonce > 0 && nonce < work->blk.nonce - bitforce->nonces - 1)))) {
+				applog(LOG_DEBUG, "BFL%i: Disabling broken nonce range support", bitforce->device_id);
+				bitforce->nonce_range = false;
+		}
+			
 		submit_nonce(thr, work, nonce);
 		if (pnoncebuf[8] != ',')
 			break;