Browse Source

stratum: handle standard method if extranonce is ignored

seen on yamp.com pools
2upstream
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
sret = stratum_recv_line(sctx); sret = stratum_recv_line(sctx);
if (sret) { if (sret) {
json_t *extra = JSON_LOADS(sret, &err); json_t *extra = JSON_LOADS(sret, &err);
free(sret);
if (!extra) { if (!extra) {
applog(LOG_WARNING, "JSON decode failed(%d): %s", err.line, err.text); applog(LOG_WARNING, "JSON decode failed(%d): %s", err.line, err.text);
} else { } else {
if (json_integer_value(json_object_get(extra, "id")) != 3) { 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 { } else {
res_val = json_object_get(extra, "result"); res_val = json_object_get(extra, "result");
if (opt_debug && (!res_val || json_is_false(res_val))) 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); json_decref(extra);
} }
free(sret);
} }
out: out:

Loading…
Cancel
Save