Browse Source

Fix 1st 10 minute preauth to still grab suggested diff and auth the rest

master
Con Kolivas 10 years ago
parent
commit
6db343fec6
  1. 7
      src/stratifier.c

7
src/stratifier.c

@ -2422,9 +2422,10 @@ static json_t *parse_authorise(stratum_instance_t *client, const json_t *params_
else {
/* Preauth workers for the first 10 minutes after the user is
* first authorised by ckdb to avoid floods of worker auths.
* *errnum is implied zero already so ret will be set true. We
* don't send any auth information to ckdb from these. */
if (user->auth_time && time(NULL) - user->auth_time > 600)
* *errnum is implied zero already so ret will be set true */
if (user->auth_time && time(NULL) - user->auth_time < 600)
client->suggest_diff = client->worker_instance->mindiff;
else
*errnum = send_recv_auth(client);
if (!*errnum)
ret = true;

Loading…
Cancel
Save