From 9ac57f9ee072981db99f8f8009512f874ba04c56 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Tue, 2 Sep 2014 00:15:09 +1000 Subject: [PATCH] Separate user from worker last share times --- src/stratifier.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/stratifier.c b/src/stratifier.c index 07110a29..d9271010 100644 --- a/src/stratifier.c +++ b/src/stratifier.c @@ -1525,20 +1525,23 @@ static void add_submit(ckpool_t *ckp, stratum_instance_t *client, int diff, bool network_diff = current_workbase->network_diff; ck_runlock(&workbase_lock); - tdiff = sane_tdiff(&now_t, &client->last_share); if (!client->first_share.tv_sec) { copy_tv(&client->first_share, &now_t); copy_tv(&client->ldc, &now_t); } + + tdiff = sane_tdiff(&now_t, &client->last_share); decay_time(&client->dsps1, diff, tdiff, 60); decay_time(&client->dsps5, diff, tdiff, 300); decay_time(&client->dsps60, diff, tdiff, 3600); decay_time(&client->dsps1440, diff, tdiff, 86400); + copy_tv(&client->last_share, &now_t); + + tdiff = sane_tdiff(&now_t, &instance->last_share); decay_time(&instance->dsps1, diff, tdiff, 60); decay_time(&instance->dsps5, diff, tdiff, 300); decay_time(&instance->dsps60, diff, tdiff, 3600); decay_time(&instance->dsps1440, diff, tdiff, 86400); - copy_tv(&client->last_share, &now_t); copy_tv(&instance->last_share, &now_t); client->idle = false;