smartlist_subtract(sl,excludedexits);
if (options.StrictExitNodes || smartlist_overlap(sl,preferredexits))
smartlist_intersect(sl,preferredexits);
- router = smartlist_choose(sl);
+ router = routerlist_sl_choose_by_bandwidth(sl);
} else {
/* Either there are no pending connections, or no routers even seem to
* possibly support any of them. Choose a router at random. */
smartlist_subtract(sl,excludedexits);
if (options.StrictExitNodes || smartlist_overlap(sl,preferredexits))
smartlist_intersect(sl,preferredexits);
- router = smartlist_choose(sl);
+ router = routerlist_sl_choose_by_bandwidth(sl);
}
smartlist_free(preferredexits);
struct smartlist_t;
void add_nickname_list_to_smartlist(struct smartlist_t *sl, const char *list);
int router_nickname_matches(routerinfo_t *router, const char *nickname);
+routerinfo_t *routerlist_sl_choose_by_bandwidth(smartlist_t *sl);
routerinfo_t *router_choose_random_node(char *preferred, char *excluded,
struct smartlist_t *excludedsmartlist,
int preferuptime, int preferbandwidth,