Commit 609ca9292a0ce60b5f93dab9ecc884fef77adfce

Con Kolivas 2013-11-05T08:03:24

Scale diff for scrypt when testing for block solves.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/cgminer.c b/cgminer.c
index ca717bc..bd5a7ed 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -6226,9 +6226,14 @@ bool test_nonce_diff(struct work *work, uint32_t nonce, double diff)
 
 static void update_work_stats(struct thr_info *thr, struct work *work)
 {
+	double test_diff = current_diff;
+
 	work->share_diff = share_diff(work);
 
-	if (unlikely(work->share_diff >= current_diff)) {
+	if (opt_scrypt)
+		test_diff *= 65536;
+
+	if (unlikely(work->share_diff >= test_diff)) {
 		work->block = true;
 		work->pool->solved++;
 		found_blocks++;