mirror of
https://github.com/xmrig/xmrig.git
synced 2025-12-07 07:55:04 -05:00
Backport changes from xmrig-aeon.
This commit is contained in:
21
stratum.c
21
stratum.c
@@ -329,18 +329,11 @@ bool stratum_authorize(struct stratum_ctx *sctx, const char *user, const char *p
|
||||
return false;
|
||||
}
|
||||
|
||||
login_decode(sctx, val);
|
||||
|
||||
job(sctx, json_object_get(result, "job"));
|
||||
// json_t *job = json_object_get(result, "job");
|
||||
|
||||
|
||||
|
||||
//pthread_mutex_lock(&sctx->work_lock);
|
||||
//if (job) {
|
||||
// job_decode(sctx, job);
|
||||
//}
|
||||
//pthread_mutex_unlock(&sctx->work_lock);
|
||||
if (login_decode(sctx, val) && job(sctx, json_object_get(result, "job"))) {
|
||||
pthread_mutex_lock(&sctx->sock_lock);
|
||||
sctx->ready = true;
|
||||
pthread_mutex_unlock(&sctx->sock_lock);
|
||||
}
|
||||
|
||||
json_decref(val);
|
||||
return true;
|
||||
@@ -609,10 +602,6 @@ static bool login_decode(struct stratum_ctx *sctx, const json_t *val) {
|
||||
memset(&sctx->id, 0, sizeof(sctx->id));
|
||||
memcpy(&sctx->id, id, strlen(id));
|
||||
|
||||
pthread_mutex_lock(&sctx->sock_lock);
|
||||
sctx->ready = true;
|
||||
pthread_mutex_unlock(&sctx->sock_lock);
|
||||
|
||||
const char *s = json_string_value(json_object_get(res, "status"));
|
||||
if (!s) {
|
||||
applog(LOG_ERR, "JSON invalid status");
|
||||
|
||||
Reference in New Issue
Block a user