From 3ec08eca6e68e7d63359447b31ed114fd188dfb3 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Sat, 7 Jan 2017 00:37:31 +1100 Subject: [PATCH] Don't drop passthroughs as well for not authorising now that their client instance is kept around. --- src/stratifier.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/stratifier.c b/src/stratifier.c index 50dee580..12cc62f2 100644 --- a/src/stratifier.c +++ b/src/stratifier.c @@ -3316,6 +3316,11 @@ static inline bool client_active(stratum_instance_t *client) return (client->authorised && !client->dropped); } +static inline bool remote_server(stratum_instance_t *client) +{ + return (client->node || client->passthrough || client->trusted); +} + /* Ask the connector asynchronously to send us dropclient commands if this * client no longer exists. */ static void connector_test_client(ckpool_t *ckp, const int64_t id) @@ -3356,7 +3361,7 @@ static void stratum_broadcast(sdata_t *sdata, json_t *val, const int msg_type) if (sdata != ckp_sdata && client->sdata != sdata) continue; - if (!client_active(client) || client->node || client->trusted) + if (!client_active(client) || remote_server(client)) continue; /* Only send messages to whitelisted clients */ @@ -7963,7 +7968,7 @@ static void *statsupdate(void *arg) * connector if they still exist */ if (client->dropped) connector_test_client(ckp, client->id); - else if (client->node || client->trusted) { + else if (remote_server(client)) { /* Do nothing to these */ } else if (!client->authorised) { /* Test for clients that haven't authed in over a minute