mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-11 07:17:58 +00:00
Revert "Cope with out of order messages coming in upon attempting to auth_stratum."
This reverts commit 237f67c617
.
This commit is contained in:
parent
ed903ddf31
commit
c9b4f5c757
16
util.c
16
util.c
@ -1369,29 +1369,23 @@ bool auth_stratum(struct pool *pool)
|
|||||||
json_error_t err;
|
json_error_t err;
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
|
|
||||||
pool->stratum_notify = false;
|
|
||||||
|
|
||||||
sprintf(s, "{\"id\": %d, \"method\": \"mining.authorize\", \"params\": [\"%s\", \"%s\"]}",
|
sprintf(s, "{\"id\": %d, \"method\": \"mining.authorize\", \"params\": [\"%s\", \"%s\"]}",
|
||||||
swork_id++, pool->rpc_user, pool->rpc_pass);
|
swork_id++, pool->rpc_user, pool->rpc_pass);
|
||||||
|
|
||||||
if (!stratum_send(pool, s, strlen(s)))
|
if (!stratum_send(pool, s, strlen(s)))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
/* Parse all data in the queue and break out should we run out of data
|
/* Parse all data in the queue and anything left should be auth */
|
||||||
* or we have successfully parsed a notify message. */
|
|
||||||
while (42) {
|
while (42) {
|
||||||
sret = recv_line(pool);
|
sret = recv_line(pool);
|
||||||
if (!sret)
|
if (!sret)
|
||||||
goto out;
|
goto out;
|
||||||
if (parse_method(pool, sret)) {
|
if (parse_method(pool, sret))
|
||||||
free(sret);
|
free(sret);
|
||||||
if (pool->stratum_notify)
|
else
|
||||||
break;
|
|
||||||
} else
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!pool->stratum_notify) {
|
|
||||||
val = JSON_LOADS(sret, &err);
|
val = JSON_LOADS(sret, &err);
|
||||||
free(sret);
|
free(sret);
|
||||||
res_val = json_object_get(val, "result");
|
res_val = json_object_get(val, "result");
|
||||||
@ -1406,9 +1400,7 @@ bool auth_stratum(struct pool *pool)
|
|||||||
ss = strdup("(unknown reason)");
|
ss = strdup("(unknown reason)");
|
||||||
applog(LOG_WARNING, "JSON stratum auth failed: %s", ss);
|
applog(LOG_WARNING, "JSON stratum auth failed: %s", ss);
|
||||||
free(ss);
|
free(ss);
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
applog(LOG_WARNING, "Failed to auth stratum");
|
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user