From 68bfb5bab4f944488e62bc1db90fb450f1b4aecb Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Sat, 21 Mar 2015 18:26:27 +1100 Subject: [PATCH] Adjust the best global proxy only when there's a change in global proxies --- src/stratifier.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/stratifier.c b/src/stratifier.c index 982820ca..f1005db4 100644 --- a/src/stratifier.c +++ b/src/stratifier.c @@ -1373,6 +1373,8 @@ static void check_bestproxy(sdata_t *sdata) HASH_ITER(hh, sdata->proxies, proxy, tmp) { if (!__subproxies_alive(proxy)) continue; + if (!proxy->global) + break; if (proxy != sdata->proxy) { sdata->proxy = proxy; changed_id = proxy->id; @@ -1397,7 +1399,8 @@ static void dead_proxyid(sdata_t *sdata, const int id, const int subid) proxy = existing_subproxy(sdata, id, subid); if (proxy) proxy->dead = true; - check_bestproxy(sdata); + if (proxy->global) + check_bestproxy(sdata); LOGINFO("Stratifier dropping clients from proxy %d:%d", id, subid); headroom = current_headroom(sdata, &proxy); @@ -1609,7 +1612,8 @@ static void update_notify(ckpool_t *ckp, const char *cmd) LOGNOTICE("Block hash on proxy %d changed to %s", id, dsdata->lastswaphash); } - check_bestproxy(sdata); + if (proxy->global) + check_bestproxy(sdata); clean |= new_block; LOGINFO("Proxy %d:%d broadcast updated stratum notify with%s clean", id, subid, clean ? "" : "out");