From 745d95246c12f403cb2c6160bd5194bfdcccc9f6 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Thu, 5 Feb 2015 10:49:41 +1100 Subject: [PATCH] Check for client ref counts in dropall --- src/stratifier.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/stratifier.c b/src/stratifier.c index 9231d6c6..39188872 100644 --- a/src/stratifier.c +++ b/src/stratifier.c @@ -936,8 +936,11 @@ static void drop_allclients(ckpool_t *ckp) ck_wlock(&sdata->instance_lock); HASH_ITER(hh, sdata->stratum_instances, client, tmp) { - HASH_DEL(sdata->stratum_instances, client); - __kill_instance(client); + if (!client->ref) { + HASH_DEL(sdata->stratum_instances, client); + __kill_instance(client); + } else + client->dropped = true; kills++; sprintf(buf, "dropclient=%"PRId64, client->id); send_proc(ckp->connector, buf);