diff --git a/src/stratifier.c b/src/stratifier.c index fce0b8ed..222429bc 100644 --- a/src/stratifier.c +++ b/src/stratifier.c @@ -2201,6 +2201,7 @@ static user_instance_t *generate_user(ckpool_t *ckp, stratum_instance_t *client, user->id = sdata->user_instance_id++; HASH_ADD_STR(sdata->user_instances, username, user); } + client->user_instance = user; DL_FOREACH(user->worker_instances, tmp) { if (!safecmp(workername, tmp->workername)) { client->worker_instance = tmp; @@ -2411,7 +2412,7 @@ static json_t *parse_authorise(stratum_instance_t *client, const json_t *params_ *err_val = json_string("Invalid character in username"); goto out; } - user = client->user_instance = generate_user(ckp, client, buf); + user = generate_user(ckp, client, buf); client->user_id = user->id; ts_realtime(&now); client->start_time = now.tv_sec;