|
|
|
@ -1556,6 +1556,12 @@ static void *proxy_send(void *arg)
|
|
|
|
|
proxyid); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
subproxy = subproxy_by_id(proxy, subid); |
|
|
|
|
if (unlikely(!subproxy)) { |
|
|
|
|
LOGWARNING("Proxysend for got message for non-existent subproxy %d:%d", |
|
|
|
|
proxyid, subid); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
mutex_lock(&proxy->notify_lock); |
|
|
|
|
HASH_FIND_INT(proxy->notify_instances, &id, ni); |
|
|
|
@ -1563,14 +1569,14 @@ static void *proxy_send(void *arg)
|
|
|
|
|
jobid = json_copy(ni->jobid); |
|
|
|
|
mutex_unlock(&proxy->notify_lock); |
|
|
|
|
|
|
|
|
|
subproxy = subproxy_by_id(proxy, subid); |
|
|
|
|
if (unlikely(!subproxy)) { |
|
|
|
|
LOGWARNING("Proxysend for got message for non-existent subproxy %d:%d", |
|
|
|
|
proxyid, subid); |
|
|
|
|
if (unlikely(!jobid)) { |
|
|
|
|
stratifier_reconnect_client(ckp, client_id); |
|
|
|
|
LOGNOTICE("Proxy %d:%s failed to find matching jobid in proxysend", |
|
|
|
|
proxy->id, proxy->url); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
cs = &subproxy->cs; |
|
|
|
|
if (jobid) { |
|
|
|
|
JSON_CPACK(val, "{s[soooo]soss}", "params", proxy->auth, jobid, |
|
|
|
|
json_object_dup(msg->json_msg, "nonce2"), |
|
|
|
|
json_object_dup(msg->json_msg, "ntime"), |
|
|
|
@ -1579,11 +1585,6 @@ static void *proxy_send(void *arg)
|
|
|
|
|
"method", "mining.submit"); |
|
|
|
|
ret = send_json_msg(cs, val); |
|
|
|
|
json_decref(val); |
|
|
|
|
} else { |
|
|
|
|
stratifier_reconnect_client(ckp, client_id); |
|
|
|
|
LOGNOTICE("Proxy %d:%s failed to find matching jobid in proxysend", |
|
|
|
|
proxy->id, proxy->url); |
|
|
|
|
} |
|
|
|
|
if (!ret) { |
|
|
|
|
LOGNOTICE("Proxy %d:%d %s failed to send msg in proxy_send, dropping to reconnect", |
|
|
|
|
proxy->id, subid, proxy->url); |
|
|
|
|