mirror of
https://git.wownero.com/wownero/wownero-puddle.git
synced 2024-08-15 01:03:20 +00:00
improve bad share handling
(reported by cohcho, thank you)
This commit is contained in:
parent
7ec47709fa
commit
dd16769ab6
1 changed files with 10 additions and 11 deletions
21
src/pool.c
21
src/pool.c
|
@ -2585,17 +2585,6 @@ client_on_read(struct bufferevent *bev, void *ctx)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (client->bad_shares > MAX_BAD_SHARES)
|
|
||||||
{
|
|
||||||
char body[ERROR_BODY_MAX];
|
|
||||||
stratum_get_error_body(body, client->json_id, too_bad);
|
|
||||||
evbuffer_add(output, body, strlen(body));
|
|
||||||
log_info(too_bad);
|
|
||||||
evbuffer_drain(input, len);
|
|
||||||
client_clear(bev);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
while ((line = evbuffer_readln(input, &n, EVBUFFER_EOL_LF)))
|
while ((line = evbuffer_readln(input, &n, EVBUFFER_EOL_LF)))
|
||||||
{
|
{
|
||||||
json_object *message = json_tokener_parse(line);
|
json_object *message = json_tokener_parse(line);
|
||||||
|
@ -2661,6 +2650,16 @@ client_on_read(struct bufferevent *bev, void *ctx)
|
||||||
client_clear(bev);
|
client_clear(bev);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (client->bad_shares > MAX_BAD_SHARES)
|
||||||
|
{
|
||||||
|
char body[ERROR_BODY_MAX];
|
||||||
|
stratum_get_error_body(body, client->json_id, too_bad);
|
||||||
|
evbuffer_add(output, body, strlen(body));
|
||||||
|
log_info(too_bad);
|
||||||
|
evbuffer_drain(input, len);
|
||||||
|
client_clear(bev);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue