From f5306156f724ed75515a5aee9f8520b4ef7a89ee Mon Sep 17 00:00:00 2001 From: Denis Ahrens Date: Sat, 22 Dec 2012 21:39:40 +0100 Subject: [PATCH] driver-ztex: only reset errors if there are some Only check the errors and print the log message if there actually were errros. --- driver-ztex.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/driver-ztex.c b/driver-ztex.c index 8ef2910b..19ec066b 100644 --- a/driver-ztex.c +++ b/driver-ztex.c @@ -327,11 +327,13 @@ static int64_t ztex_scanhash(struct thr_info *thr, struct work *work, // only add the errorCount if we had at least some valid nonces or // had no valid nonces in the last round - if (ztex->nonceCheckValid > 0 && validNonces == 0) { - applog(LOG_ERR, "%s: resetting %.1f errors", ztex->repr, errorCount); - } - else { - ztex->errorCount[ztex->freqM] += errorCount; + if (errorCount > 0.0) { + if (ztex->nonceCheckValid > 0 && validNonces == 0) { + applog(LOG_ERR, "%s: resetting %.1f errors", ztex->repr, errorCount); + } + else { + ztex->errorCount[ztex->freqM] += errorCount; + } } // remember the number of valid nonces for the check in the next round