# HG changeset patch # User Thomas Klausner # Date 1371721884 -7200 # Node ID 6f75842935f6ae42c3e34e9841c7dc7f78c66fa6 # Parent cec3e9b579e1041df4e56ecd1458f880228eab67 Reduce candidate score down to 1 due to load balancing. Before, the maximum reduction was 5. diff -r cec3e9b579e1 -r 6f75842935f6 extensions/rt_load_balance/rt_load_balance.c --- a/extensions/rt_load_balance/rt_load_balance.c Thu Jun 20 14:31:49 2013 +0800 +++ b/extensions/rt_load_balance/rt_load_balance.c Thu Jun 20 11:51:24 2013 +0200 @@ -59,8 +59,8 @@ CHECK_FCT(fd_peer_get_load_pending(peer, &to_receive, &to_send)); load = to_receive + to_send; score = cand->score; - if (load > 5) - cand->score -= 5; + if ((cand->score > 0) && (load >= cand->score)) + cand->score = 1; else cand->score -= load; TRACE_DEBUG(INFO, "evaluated peer `%.*s', score was %d, now %d", (int)cand->diamidlen, cand->diamid, score, cand->score);