And in dirserv_thinks_router_is_unreliable() we have:
if (need_capacity) { uint32_t bw_kb = dirserv_get_credible_bandwidth_kb(router); if (bw_kb < fast_bandwidth_kb) return 1; } return 0;
which is straightforward and relies on dirserv_get_credible_bandwidth_kb().
So, now let's dig into the interesting function dirserv_get_credible_bandwidth_kb(), which tells us:
/** Return the bandwidth we believe for assigning flags; prefer measured * over advertised, and if we have above a threshold quantity of measured * bandwidths, we don't want to ever give flags to unmeasured routers, so * return 0. */
The threshold is enforced here:
/* Check if we have a measured bandwidth, and check the threshold if not */ if (!(dirserv_query_measured_bw_cache_kb(ri->cache_info.identity_digest, &mbw_kb, NULL))) { threshold = get_options()->MinMeasuredBWsForAuthToIgnoreAdvertised; if (routers_with_measured_bw > threshold) { /* Return zero for unmeasured bandwidth if we are above threshold */ bw_kb = 0;
Since, bwauths are enabled, I would have assumed that we are above that threshold and the bandwidth value for all unmeasured relays would be set to 0, however since unmeasured relays get the Fast flag it probably isn't the case.
You're right, but I'm not even convinced if that is bad in the current network where the bwauths miss massive amounts of relays for extended amounts of time