Browse Source

Don't send any preauths for already authorised users for the first 10 minutes after their first successful auth

master
Con Kolivas 10 years ago
parent
commit
0a616baa46
  1. 7
      src/stratifier.c

7
src/stratifier.c

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

Loading…
Cancel
Save