Browse Source

stratum: handle standard method if extranonce is ignored

seen on yamp.com pools
master
Tanguy Pruvot 10 years ago
parent
commit
d7c13b0611
  1. 6
      util.cpp

6
util.cpp

@ -1098,12 +1098,13 @@ bool stratum_authorize(struct stratum_ctx *sctx, const char *user, const char *p @@ -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 @@ -1111,6 +1112,7 @@ bool stratum_authorize(struct stratum_ctx *sctx, const char *user, const char *p
}
json_decref(extra);
}
free(sret);
}
out:

Loading…
Cancel
Save