From ab67bb2432d48c4d1aabc0f641bb5b21d2ff3ccc Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Thu, 11 Sep 2014 22:41:40 +1000 Subject: [PATCH] Only keep existing downstream connections in proxy mode when attaching an upstream pool successfully in resume mode --- src/generator.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/generator.c b/src/generator.c index 3238849e..e23a173c 100644 --- a/src/generator.c +++ b/src/generator.c @@ -534,8 +534,8 @@ out: static bool subscribe_stratum(connsock_t *cs, proxy_instance_t *proxi) { - json_t *req; bool ret = false; + json_t *req; retry: /* Attempt to reconnect if the pool supports resuming */ @@ -589,6 +589,10 @@ retry: goto retry; out: + /* Only keep any downstream connections if we're successfully resuming + * to the existing stratum sessionid */ + if (!ret || !proxi->sessionid) + send_proc(proxi->ckp->stratifier, "dropall"); return ret; }