Merge branch 'dont-require-bandwidthcapacity' into 'main'

In router_is_active, don't require non-zero bandwidthcapacity

Closes #13000 and #40917

See merge request tpo/core/tor!801
This commit is contained in:
David Goulet 2024-03-12 12:51:18 +00:00
commit d1e8c7a603

View File

@ -112,8 +112,7 @@ dirserv_thinks_router_is_unreliable(time_t now,
} }
/** Return 1 if <b>ri</b>'s descriptor is "active" -- running, valid, /** Return 1 if <b>ri</b>'s descriptor is "active" -- running, valid,
* not hibernating, having observed bw greater 0, and not too old. Else * not hibernating, and not too old. Else return 0.
* return 0.
*/ */
static int static int
router_is_active(const routerinfo_t *ri, const node_t *node, time_t now) router_is_active(const routerinfo_t *ri, const node_t *node, time_t now)
@ -125,20 +124,6 @@ router_is_active(const routerinfo_t *ri, const node_t *node, time_t now)
if (!node->is_running || !node->is_valid || ri->is_hibernating) { if (!node->is_running || !node->is_valid || ri->is_hibernating) {
return 0; return 0;
} }
/* Only require bandwidth capacity in non-test networks, or
* if TestingTorNetwork, and TestingMinExitFlagThreshold is non-zero */
if (!ri->bandwidthcapacity) {
if (get_options()->TestingTorNetwork) {
if (dirauth_get_options()->TestingMinExitFlagThreshold > 0) {
/* If we're in a TestingTorNetwork, and TestingMinExitFlagThreshold is,
* then require bandwidthcapacity */
return 0;
}
} else {
/* If we're not in a TestingTorNetwork, then require bandwidthcapacity */
return 0;
}
}
return 1; return 1;
} }