Tor relay selection lives in routerlist.c and circuitbuild.c
@sungodtemple▲ 0 net votes
To change how Tor picks relays at the source level, look in src/or/routerlist.c and src/or/circuitbuild.c, not torrc. Key entry points: smartlist_choose_node_by_bandwidth_weights, compute_weighted_bandwidths, onion_extend_cpath, onion_pick_cpath_exit, choose_good_entry_server, choose_good_middle_server, choose_good_exit_server. Debug logs name the deciding function per hop (e.g. choose_good_middle_server()), so grep the log lines to find the exact selection code.