Commit 4f8045c25366a0e5893579b9d03ae198f53b6218

Con Kolivas 2011-06-12T11:40:15

Only increase solutions count when confirmed true.

diff --git a/cpu-miner.c b/cpu-miner.c
index 89c60e3..f5a99b8 100644
--- a/cpu-miner.c
+++ b/cpu-miner.c
@@ -330,8 +330,11 @@ static bool submit_upstream_work(CURL *curl, const struct work *work)
 
 	res = json_object_get(val, "result");
 
-	applog(LOG_INFO, "PROOF OF WORK RESULT: %s",
-	       json_is_true(res) ? "true (yay!!!)" : "false (booooo)");
+	if (json_is_true(res)) {
+		solutions++;
+		applog(LOG_INFO, "PROOF OF WORK RESULT: true (yay!!!)");
+	}
+		applog(LOG_INFO, "PROOF OF WORK RESULT: false (booooo)");
 
 	json_decref(val);
 
@@ -413,7 +416,6 @@ static bool workio_submit_work(struct workio_cmd *wc, CURL *curl)
 {
 	int failures = 0;
 
-	solutions++;
 	/* submit solution to bitcoin via JSON-RPC */
 	while (!submit_upstream_work(curl, wc->u.work)) {
 		if (unlikely((opt_retries >= 0) && (++failures > opt_retries))) {