|
|
@ -1160,10 +1160,11 @@ static void reconnect_clients(sdata_t *sdata) |
|
|
|
HASH_ITER(hh, sdata->stratum_instances, client, tmpclient) { |
|
|
|
HASH_ITER(hh, sdata->stratum_instances, client, tmpclient) { |
|
|
|
if (client->proxyid == proxy->id && client->notify_id == proxy->parent->notify_id) |
|
|
|
if (client->proxyid == proxy->id && client->notify_id == proxy->parent->notify_id) |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
if (client->reconnect) |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
headroom--; |
|
|
|
headroom--; |
|
|
|
reconnects++; |
|
|
|
reconnects++; |
|
|
|
|
|
|
|
if (client->reconnect) |
|
|
|
|
|
|
|
reconnect_client(sdata, client); |
|
|
|
|
|
|
|
else |
|
|
|
client->reconnect = true; |
|
|
|
client->reconnect = true; |
|
|
|
} |
|
|
|
} |
|
|
|
ck_runlock(&sdata->instance_lock); |
|
|
|
ck_runlock(&sdata->instance_lock); |
|
|
@ -2122,7 +2123,6 @@ static void reconnect_client(sdata_t *sdata, stratum_instance_t *client) |
|
|
|
client->dropped = true; |
|
|
|
client->dropped = true; |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
client->reconnect = false; |
|
|
|
|
|
|
|
client->reconnect_request = time(NULL); |
|
|
|
client->reconnect_request = time(NULL); |
|
|
|
JSON_CPACK(json_msg, "{sosss[]}", "id", json_null(), "method", "client.reconnect", |
|
|
|
JSON_CPACK(json_msg, "{sosss[]}", "id", json_null(), "method", "client.reconnect", |
|
|
|
"params"); |
|
|
|
"params"); |
|
|
@ -2170,10 +2170,11 @@ static void dead_proxy(sdata_t *sdata, const char *buf) |
|
|
|
HASH_ITER(hh, sdata->stratum_instances, client, tmp) { |
|
|
|
HASH_ITER(hh, sdata->stratum_instances, client, tmp) { |
|
|
|
if (client->proxyid != id || client->subproxyid != subid) |
|
|
|
if (client->proxyid != id || client->subproxyid != subid) |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
if (client->reconnect) |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
headroom--; |
|
|
|
headroom--; |
|
|
|
reconnects++; |
|
|
|
reconnects++; |
|
|
|
|
|
|
|
if (client->reconnect) |
|
|
|
|
|
|
|
reconnect_client(sdata, client); |
|
|
|
|
|
|
|
else |
|
|
|
client->reconnect = true; |
|
|
|
client->reconnect = true; |
|
|
|
} |
|
|
|
} |
|
|
|
ck_runlock(&sdata->instance_lock); |
|
|
|
ck_runlock(&sdata->instance_lock); |
|
|
|