|
|
@ -3275,9 +3275,14 @@ static void __drop_client(sdata_t *sdata, stratum_instance_t *client, bool lazil |
|
|
|
|
|
|
|
|
|
|
|
if (client->workername) { |
|
|
|
if (client->workername) { |
|
|
|
if (user) { |
|
|
|
if (user) { |
|
|
|
ASPRINTF(msg, "Dropped client %s %s %suser %s worker %s %s", |
|
|
|
/* No message anywhere if throttled, too much flood and
|
|
|
|
client->identity, client->address, user->throttled ? "throttled " : "", |
|
|
|
* these only can be LOGNOTICE messages. |
|
|
|
user->username, client->workername, lazily ? "lazily" : ""); |
|
|
|
*/ |
|
|
|
|
|
|
|
if (!user->throttled) { |
|
|
|
|
|
|
|
ASPRINTF(msg, "Dropped client %s %suser %s worker %s %s", |
|
|
|
|
|
|
|
client->identity, client->address, |
|
|
|
|
|
|
|
user->username, client->workername, lazily ? "lazily" : ""); |
|
|
|
|
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
ASPRINTF(msg, "Dropped client %s %s no user worker %s %s", |
|
|
|
ASPRINTF(msg, "Dropped client %s %s no user worker %s %s", |
|
|
|
client->identity, client->address, client->workername, |
|
|
|
client->identity, client->address, client->workername, |
|
|
@ -5586,9 +5591,15 @@ static void client_auth(ckpool_t *ckp, stratum_instance_t *client, user_instance |
|
|
|
user->auth_backoff = DEFAULT_AUTH_BACKOFF; /* Reset auth backoff time */ |
|
|
|
user->auth_backoff = DEFAULT_AUTH_BACKOFF; /* Reset auth backoff time */ |
|
|
|
user->throttled = false; |
|
|
|
user->throttled = false; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
LOGNOTICE("Client %s %s worker %s failed to authorise as user %s", |
|
|
|
if (user->throttled) { |
|
|
|
client->identity, client->address, client->workername, |
|
|
|
LOGINFO("Client %s %s worker %s failed to authorise as throttled user %s", |
|
|
|
user->username); |
|
|
|
client->identity, client->address, client->workername, |
|
|
|
|
|
|
|
user->username); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
LOGNOTICE("Client %s %s worker %s failed to authorise as user %s", |
|
|
|
|
|
|
|
client->identity, client->address, client->workername, |
|
|
|
|
|
|
|
user->username); |
|
|
|
|
|
|
|
} |
|
|
|
user->failed_authtime = time(NULL); |
|
|
|
user->failed_authtime = time(NULL); |
|
|
|
user->auth_backoff <<= 1; |
|
|
|
user->auth_backoff <<= 1; |
|
|
|
/* Cap backoff time to 10 mins */ |
|
|
|
/* Cap backoff time to 10 mins */ |
|
|
|