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