mirror of
https://github.com/LBRYFoundation/pool.git
synced 2025-08-23 17:37:25 +00:00
stratum: pre-check bad usernames before db add
This commit is contained in:
parent
1bfec2be32
commit
138b0079bb
1 changed files with 6 additions and 5 deletions
|
@ -229,6 +229,11 @@ bool client_authorize(YAAMP_CLIENT *client, json_value *json_params)
|
|||
}
|
||||
}
|
||||
|
||||
if (!is_base58(client->username)) {
|
||||
clientlog(client, "bad mining address %s", client->username);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool reset = client_initialize_multialgo(client);
|
||||
if(reset) return false;
|
||||
|
||||
|
@ -256,12 +261,8 @@ bool client_authorize(YAAMP_CLIENT *client, json_value *json_params)
|
|||
CommonUnlock(&g_db_mutex);
|
||||
}
|
||||
|
||||
bool is_bad_address = !is_base58(client->username);
|
||||
// when auto exchange is disabled, only authorize good wallet address...
|
||||
if (!g_autoexchange && !client_validate_user_address(client))
|
||||
is_bad_address = true;
|
||||
|
||||
if (is_bad_address) {
|
||||
if (!g_autoexchange && !client_validate_user_address(client)) {
|
||||
|
||||
clientlog(client, "bad mining address %s", client->username);
|
||||
client_send_result(client, "false");
|
||||
|
|
Loading…
Add table
Reference in a new issue