Browse Source

Adjust the best global proxy only when there's a change in global proxies

master
Con Kolivas 10 years ago
parent
commit
68bfb5bab4
  1. 4
      src/stratifier.c

4
src/stratifier.c

@ -1373,6 +1373,8 @@ static void check_bestproxy(sdata_t *sdata)
HASH_ITER(hh, sdata->proxies, proxy, tmp) { HASH_ITER(hh, sdata->proxies, proxy, tmp) {
if (!__subproxies_alive(proxy)) if (!__subproxies_alive(proxy))
continue; continue;
if (!proxy->global)
break;
if (proxy != sdata->proxy) { if (proxy != sdata->proxy) {
sdata->proxy = proxy; sdata->proxy = proxy;
changed_id = proxy->id; changed_id = proxy->id;
@ -1397,6 +1399,7 @@ static void dead_proxyid(sdata_t *sdata, const int id, const int subid)
proxy = existing_subproxy(sdata, id, subid); proxy = existing_subproxy(sdata, id, subid);
if (proxy) if (proxy)
proxy->dead = true; proxy->dead = true;
if (proxy->global)
check_bestproxy(sdata); check_bestproxy(sdata);
LOGINFO("Stratifier dropping clients from proxy %d:%d", id, subid); LOGINFO("Stratifier dropping clients from proxy %d:%d", id, subid);
headroom = current_headroom(sdata, &proxy); headroom = current_headroom(sdata, &proxy);
@ -1609,6 +1612,7 @@ static void update_notify(ckpool_t *ckp, const char *cmd)
LOGNOTICE("Block hash on proxy %d changed to %s", id, dsdata->lastswaphash); LOGNOTICE("Block hash on proxy %d changed to %s", id, dsdata->lastswaphash);
} }
if (proxy->global)
check_bestproxy(sdata); check_bestproxy(sdata);
clean |= new_block; clean |= new_block;
LOGINFO("Proxy %d:%d broadcast updated stratum notify with%s clean", id, LOGINFO("Proxy %d:%d broadcast updated stratum notify with%s clean", id,

Loading…
Cancel
Save