Browse Source

scrypt: Implement test_nonce2 and submit_nonce hw error check

Luke Dashjr 13 years ago
parent
commit
f9f7e5f837
1 changed files with 10 additions and 1 deletions
  1. 10 1
      miner.c

+ 10 - 1
miner.c

@@ -54,6 +54,10 @@
 	#include <sys/wait.h>
 	#include <sys/wait.h>
 #endif
 #endif
 
 
+#ifdef USE_SCRYPT
+#include "scrypt.h"
+#endif
+
 #if defined(USE_BITFORCE) || defined(USE_ICARUS) || defined(USE_MODMINER)
 #if defined(USE_BITFORCE) || defined(USE_ICARUS) || defined(USE_MODMINER)
 #	define USE_FPGA
 #	define USE_FPGA
 #	define USE_FPGA_SERIAL
 #	define USE_FPGA_SERIAL
@@ -4378,8 +4382,13 @@ enum test_nonce2_result _test_nonce2(struct work *work, uint32_t nonce, bool che
 	uint32_t *work_nonce = (uint32_t *)(work->data + 64 + 12);
 	uint32_t *work_nonce = (uint32_t *)(work->data + 64 + 12);
 	*work_nonce = nonce;
 	*work_nonce = nonce;
 
 
-	if (opt_scrypt)
+#ifdef USE_SCRYPT
+	if (opt_scrypt) {
+		if (!scrypt_test(work->data, work->target, nonce))
+			return TNR_BAD;
 		return TNR_GOOD;
 		return TNR_GOOD;
+	}
+#endif
 
 
 	return hashtest2(work, checktarget);
 	return hashtest2(work, checktarget);
 }
 }