From 2358d03037eac1eb399ef30e3a9fc017cd409d9b Mon Sep 17 00:00:00 2001 From: ckolivas Date: Thu, 22 May 2014 10:33:10 +1000 Subject: [PATCH] Add pplns shares from reconnected users to the pool's total --- src/stratifier.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/stratifier.c b/src/stratifier.c index 449e27b0..33482d9e 100644 --- a/src/stratifier.c +++ b/src/stratifier.c @@ -1073,6 +1073,7 @@ static user_instance_t *authorise_user(const stratum_instance_t *client, char *fullname = strdupa(workername); char *username = strsep(&fullname, "."); user_instance_t *instance; + int64_t pplns_shares = 0; if (strlen(username) > 127) username[127] = '\0'; @@ -1102,9 +1103,16 @@ static user_instance_t *authorise_user(const stratum_instance_t *client, instance->id = user_instance_id++; HASH_ADD_STR(user_instances, username, instance); ck_dwilock(&instance_lock); + pplns_shares = instance->pplns_shares; } ck_uilock(&instance_lock); + if (pplns_shares) { + mutex_lock(&stats_lock); + stats.accounted_diff_shares += pplns_shares; + mutex_unlock(&stats_lock); + } + return instance; }