From 6887f778e9e88238ed34d8addfe190410dc14d3f Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Mon, 23 Feb 2015 12:42:25 +1100 Subject: [PATCH] Send reconnect to all clients that have been asked to reconnect already and don't unset the bool to be able to trim them --- src/stratifier.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/stratifier.c b/src/stratifier.c index 227feb4b..9d332f11 100644 --- a/src/stratifier.c +++ b/src/stratifier.c @@ -1160,11 +1160,12 @@ static void reconnect_clients(sdata_t *sdata) HASH_ITER(hh, sdata->stratum_instances, client, tmpclient) { if (client->proxyid == proxy->id && client->notify_id == proxy->parent->notify_id) continue; - if (client->reconnect) - continue; headroom--; reconnects++; - client->reconnect = true; + if (client->reconnect) + reconnect_client(sdata, client); + else + client->reconnect = true; } ck_runlock(&sdata->instance_lock); @@ -2122,7 +2123,6 @@ static void reconnect_client(sdata_t *sdata, stratum_instance_t *client) client->dropped = true; return; } - client->reconnect = false; client->reconnect_request = time(NULL); JSON_CPACK(json_msg, "{sosss[]}", "id", json_null(), "method", "client.reconnect", "params"); @@ -2170,11 +2170,12 @@ static void dead_proxy(sdata_t *sdata, const char *buf) HASH_ITER(hh, sdata->stratum_instances, client, tmp) { if (client->proxyid != id || client->subproxyid != subid) continue; - if (client->reconnect) - continue; headroom--; reconnects++; - client->reconnect = true; + if (client->reconnect) + reconnect_client(sdata, client); + else + client->reconnect = true; } ck_runlock(&sdata->instance_lock);