From 0c51e7e86315fd36b1c55ed2a93bc4fbcd2ac6b0 Mon Sep 17 00:00:00 2001 From: ckolivas Date: Sun, 18 Jan 2015 09:40:32 +1100 Subject: [PATCH] Read off best share stats if they exist per user and worker --- src/stratifier.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/stratifier.c b/src/stratifier.c index c26eed6d..a8d138ff 100644 --- a/src/stratifier.c +++ b/src/stratifier.c @@ -1833,9 +1833,10 @@ static void read_userstats(ckpool_t *ckp, user_instance_t *instance) instance->dsps60 = dsps_from_key(val, "hashrate1hr"); instance->dsps1440 = dsps_from_key(val, "hashrate1d"); instance->dsps10080 = dsps_from_key(val, "hashrate7d"); - LOGINFO("Successfully read user %s stats %f %f %f %f %f", instance->username, + json_get_double(&instance->best_diff, val, "bestshare"); + LOGINFO("Successfully read user %s stats %f %f %f %f %f %f", instance->username, instance->dsps1, instance->dsps5, instance->dsps60, instance->dsps1440, - instance->dsps10080); + instance->dsps10080, instance->best_diff); json_decref(val); } @@ -1870,8 +1871,9 @@ static void read_workerstats(ckpool_t *ckp, worker_instance_t *worker) worker->dsps5 = dsps_from_key(val, "hashrate5m"); worker->dsps60 = dsps_from_key(val, "hashrate1d"); worker->dsps1440 = dsps_from_key(val, "hashrate1d"); - LOGINFO("Successfully read worker %s stats %f %f %f %f", worker->workername, - worker->dsps1, worker->dsps5, worker->dsps60, worker->dsps1440); + json_get_double(&worker->best_diff, val, "bestshare"); + LOGINFO("Successfully read worker %s stats %f %f %f %f %f", worker->workername, + worker->dsps1, worker->dsps5, worker->dsps60, worker->dsps1440, worker->best_diff); json_decref(val); }