From 16e4eb5f830514137f123e82489cc266e53998f7 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Thu, 24 Jul 2014 12:17:03 +1000 Subject: [PATCH] Don't attempt to generate stats for clients that are not yet authorised --- src/stratifier.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/stratifier.c b/src/stratifier.c index cb3af6d5..fc741823 100644 --- a/src/stratifier.c +++ b/src/stratifier.c @@ -2288,8 +2288,11 @@ static void *statsupdate(void *arg) ck_rlock(&instance_lock); HASH_ITER(hh, stratum_instances, client, tmp) { - bool idle = false; double ghs; + bool idle; + + if (!client->authorised) + continue; if (now.tv_sec - client->last_share.tv_sec > 60) { idle = true; @@ -2300,7 +2303,8 @@ static void *statsupdate(void *arg) decay_time(&client->dsps1440, 0, tdiff, 86400); if (now.tv_sec - client->last_share.tv_sec > 600) client->idle = true; - } + } else + idle = false; ghs = client->dsps1 * nonces; suffix_string(ghs, suffix1, 16, 0); ghs = client->dsps5 * nonces;