Commit c2a4d94b16d2237c39052a6b7af0b522ea8bddaf

ckolivas 2014-01-24T17:07:39

Make submit_tested_work return a bool about whether it meets the work target or not.

diff --git a/cgminer.c b/cgminer.c
index 8008939..8707732 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -6073,18 +6073,19 @@ static void update_work_stats(struct thr_info *thr, struct work *work)
 }
 
 /* To be used once the work has been tested to be meet diff1 and has had its
- * nonce adjusted. */
-void submit_tested_work(struct thr_info *thr, struct work *work)
+ * nonce adjusted. Returns true if the work target is met. */
+bool submit_tested_work(struct thr_info *thr, struct work *work)
 {
 	struct work *work_out;
 	update_work_stats(thr, work);
 
 	if (!fulltest(work->hash, work->target)) {
 		applog(LOG_INFO, "Share above target");
-		return;
+		return false;
 	}
 	work_out = copy_work(work);
 	submit_work_async(work_out);
+	return true;
 }
 
 /* Returns true if nonce for work was a valid share */
diff --git a/miner.h b/miner.h
index dad0b00..8d5d647 100644
--- a/miner.h
+++ b/miner.h
@@ -1341,7 +1341,7 @@ extern void get_datestamp(char *, size_t, struct timeval *);
 extern void inc_hw_errors(struct thr_info *thr);
 extern bool test_nonce(struct work *work, uint32_t nonce);
 extern bool test_nonce_diff(struct work *work, uint32_t nonce, double diff);
-extern void submit_tested_work(struct thr_info *thr, struct work *work);
+extern bool submit_tested_work(struct thr_info *thr, struct work *work);
 extern bool submit_nonce(struct thr_info *thr, struct work *work, uint32_t nonce);
 extern bool submit_noffset_nonce(struct thr_info *thr, struct work *work, uint32_t nonce,
 			  int noffset);