From 4f8045c25366a0e5893579b9d03ae198f53b6218 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Sun, 12 Jun 2011 11:40:15 +1000 Subject: [PATCH] Only increase solutions count when confirmed true. --- cpu-miner.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cpu-miner.c b/cpu-miner.c index 89c60e30..f5a99b86 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))) {