From 859d5161b0f494bd75b2d81cd94a70dfb0006c75 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Tue, 20 May 2014 10:12:53 +1000 Subject: [PATCH] Fix total user hashrate being low with multiple workers --- src/stratifier.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/stratifier.c b/src/stratifier.c index ea40bf4d..5e10267c 100644 --- a/src/stratifier.c +++ b/src/stratifier.c @@ -1071,9 +1071,9 @@ static void add_submit(stratum_instance_t *client, user_instance_t *instance, in tv_t now_t; tv_time(&now_t); - tdiff = tvdiff(&now_t, &client->last_share); if (valid) { + tdiff = tvdiff(&now_t, &instance->last_share); if (unlikely(!client->absolute_shares++)) tv_time(&client->first_share); client->diff_shares += diff; @@ -1088,6 +1088,7 @@ static void add_submit(stratum_instance_t *client, user_instance_t *instance, in } else instance->diff_rejected += diff; + tdiff = tvdiff(&now_t, &client->last_share); copy_tv(&client->last_share, &now_t); client->ssdc++; decay_time(&client->dsps5, diff, tdiff, 300);