stratum: handle standard method if extranonce is ignored

seen on yamp.com pools
This commit is contained in:
Tanguy Pruvot 2014-11-23 09:22:07 +01:00
parent 6699b8a71f
commit d7c13b0611

View File

@ -1098,12 +1098,13 @@ bool stratum_authorize(struct stratum_ctx *sctx, const char *user, const char *p
sret = stratum_recv_line(sctx);
if (sret) {
json_t *extra = JSON_LOADS(sret, &err);
free(sret);
if (!extra) {
applog(LOG_WARNING, "JSON decode failed(%d): %s", err.line, err.text);
} else {
if (json_integer_value(json_object_get(extra, "id")) != 3) {
applog(LOG_WARNING, "Stratum extranonce answer id is not correct!");
// we receive a standard method if extranonce is ignored
if (!stratum_handle_method(sctx, sret))
applog(LOG_WARNING, "Stratum extranonce answer id was not correct!");
} else {
res_val = json_object_get(extra, "result");
if (opt_debug && (!res_val || json_is_false(res_val)))
@ -1111,6 +1112,7 @@ bool stratum_authorize(struct stratum_ctx *sctx, const char *user, const char *p
}
json_decref(extra);
}
free(sret);
}
out: