diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c index 08ee58416b..eef610d2b6 100644 --- a/src/or/circuitbuild.c +++ b/src/or/circuitbuild.c @@ -2133,6 +2133,8 @@ circuit_all_predicted_ports_handled(time_t now, int *need_uptime, smartlist_t *LongLivedServices = get_options()->LongLivedPorts; tor_assert(need_uptime); tor_assert(need_capacity); + // Always predict need_capacity + *need_capacity = 1; enough = (smartlist_len(sl) == 0); for (i = 0; i < smartlist_len(sl); ++i) { port = smartlist_get(sl, i); diff --git a/src/or/rephist.c b/src/or/rephist.c index e606db3b7b..8729a12088 100644 --- a/src/or/rephist.c +++ b/src/or/rephist.c @@ -1909,8 +1909,8 @@ rep_hist_get_predicted_internal(time_t now, int *need_uptime, return 0; /* too long ago */ if (predicted_internal_uptime_time + PREDICTED_CIRCS_RELEVANCE_TIME >= now) *need_uptime = 1; - if (predicted_internal_capacity_time + PREDICTED_CIRCS_RELEVANCE_TIME >= now) - *need_capacity = 1; + // Always predict that we need capacity. + *need_capacity = 1; return 1; } diff --git a/src/or/routerlist.c b/src/or/routerlist.c index 6cd8b6d83b..80229f2141 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -2070,10 +2070,8 @@ router_choose_random_node(smartlist_t *excludedsmartlist, if (excludedset) routerset_subtract_routers(sl,excludedset); - if (need_capacity || need_guard) - choice = routerlist_sl_choose_by_bandwidth(sl, rule); - else - choice = smartlist_choose(sl); + // Always weight by bandwidth + choice = routerlist_sl_choose_by_bandwidth(sl, rule); smartlist_free(sl); if (!choice && (need_uptime || need_capacity || need_guard)) {