Commit 38eb4ee43b7f93362fd3331b4ac5960883fe1952

Con Kolivas 2012-11-11T18:09:46

Check share target diff for best_share to be calculated when solo mining.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/cgminer.c b/cgminer.c
index 8b3404c..129e261 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -5363,8 +5363,15 @@ static bool hashtest(struct thr_info *thr, struct work *work)
 	}
 
 	bool test = fulltest(work->hash, work->target);
-	if (!test)
+	if (!test) {
 		applog(LOG_INFO, "Share below target");
+		/* Check the diff of the share, even if it didn't reach the
+		 * target, just to set the best share value if it's higher. */
+		if (opt_scrypt)
+			scrypt_diff(work);
+		else
+			share_diff(work);
+	}
 
 	return test;
 }