From 0a616baa460c36bc3e08af9dfda6d6d1d5893234 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Tue, 3 Feb 2015 23:32:45 +1100 Subject: [PATCH] Don't send any preauths for already authorised users for the first 10 minutes after their first successful auth --- src/stratifier.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/stratifier.c b/src/stratifier.c index e8ad9dee..f585a856 100644 --- a/src/stratifier.c +++ b/src/stratifier.c @@ -2422,10 +2422,9 @@ 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 */ - if (user->auth_time && time(NULL) - user->auth_time < 600) - queue_delayed_auth(client); - else + * *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 = send_recv_auth(client); if (!*errnum) ret = true;