From 9f8237909f45848dfbb32653071cdec2c9672962 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Thu, 30 Oct 2014 20:18:59 +1100 Subject: [PATCH] Fix apparent dropping of hashrate on restart due to zero last share time --- src/stratifier.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/stratifier.c b/src/stratifier.c index e09f08b0..69499cc9 100644 --- a/src/stratifier.c +++ b/src/stratifier.c @@ -1662,6 +1662,7 @@ static void read_userstats(ckpool_t *ckp, user_instance_t *instance) return; } + tv_time(&instance->last_share); instance->dsps1 = dsps_from_key(val, "hashrate1m"); instance->dsps5 = dsps_from_key(val, "hashrate5m"); instance->dsps60 = dsps_from_key(val, "hashrate1hr"); @@ -1683,7 +1684,7 @@ static void read_workerstats(ckpool_t *ckp, worker_instance_t *worker) snprintf(s, 511, "%s/workers/%s", ckp->logdir, worker->workername); fp = fopen(s, "re"); if (!fp) { - LOGINFO("Worker %s does not have a logfile to read"); + LOGINFO("Worker %s does not have a logfile to read", worker->workername); return; } memset(s, 0, 512); @@ -1698,6 +1699,8 @@ static void read_workerstats(ckpool_t *ckp, worker_instance_t *worker) LOGINFO("Failed to json decode worker %s logfile: %s", worker->workername, s); return; } + + tv_time(&worker->last_share); worker->dsps1 = dsps_from_key(val, "hashrate1m"); worker->dsps5 = dsps_from_key(val, "hashrate5m"); worker->dsps60 = dsps_from_key(val, "hashrate1d");