|
|
@ -963,9 +963,9 @@ static void *proxy_send(void *arg) |
|
|
|
rename_proc("proxysend"); |
|
|
|
rename_proc("proxysend"); |
|
|
|
|
|
|
|
|
|
|
|
while (42) { |
|
|
|
while (42) { |
|
|
|
notify_instance_t *instance; |
|
|
|
notify_instance_t *ni; |
|
|
|
stratum_msg_t *msg; |
|
|
|
stratum_msg_t *msg; |
|
|
|
char *jobid; |
|
|
|
char *jobid = NULL; |
|
|
|
json_t *val; |
|
|
|
json_t *val; |
|
|
|
uint32_t id; |
|
|
|
uint32_t id; |
|
|
|
bool ret; |
|
|
|
bool ret; |
|
|
@ -984,15 +984,12 @@ static void *proxy_send(void *arg) |
|
|
|
json_uintcpy(&id, msg->json_msg, "jobid"); |
|
|
|
json_uintcpy(&id, msg->json_msg, "jobid"); |
|
|
|
|
|
|
|
|
|
|
|
mutex_lock(&proxi->notify_lock); |
|
|
|
mutex_lock(&proxi->notify_lock); |
|
|
|
HASH_FIND_INT(proxi->notify_instances, &id, instance); |
|
|
|
HASH_FIND_INT(proxi->notify_instances, &id, ni); |
|
|
|
if (instance) |
|
|
|
if (ni) |
|
|
|
jobid = strdup(instance->jobid); |
|
|
|
jobid = strdup(ni->jobid); |
|
|
|
mutex_unlock(&proxi->notify_lock); |
|
|
|
mutex_unlock(&proxi->notify_lock); |
|
|
|
|
|
|
|
|
|
|
|
if (!instance) { |
|
|
|
if (jobid) { |
|
|
|
LOGWARNING("Failed to find matching jobid in proxysend"); |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
val = json_pack("{s[ssooo]soss}", "params", proxi->auth, jobid, |
|
|
|
val = json_pack("{s[ssooo]soss}", "params", proxi->auth, jobid, |
|
|
|
json_object_get(msg->json_msg, "nonce2"), |
|
|
|
json_object_get(msg->json_msg, "nonce2"), |
|
|
|
json_object_get(msg->json_msg, "ntime"), |
|
|
|
json_object_get(msg->json_msg, "ntime"), |
|
|
@ -1002,6 +999,8 @@ static void *proxy_send(void *arg) |
|
|
|
free(jobid); |
|
|
|
free(jobid); |
|
|
|
ret = send_json_msg(cs, val); |
|
|
|
ret = send_json_msg(cs, val); |
|
|
|
json_decref(val); |
|
|
|
json_decref(val); |
|
|
|
|
|
|
|
} else |
|
|
|
|
|
|
|
LOGWARNING("Failed to find matching jobid in proxysend"); |
|
|
|
json_decref(msg->json_msg); |
|
|
|
json_decref(msg->json_msg); |
|
|
|
free(msg); |
|
|
|
free(msg); |
|
|
|
if (!ret) { |
|
|
|
if (!ret) { |
|
|
|