aboutsummaryrefslogtreecommitdiff
path: root/src/or/routerlist.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/or/routerlist.c')
-rw-r--r--src/or/routerlist.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index 5f98abe01b..968d5a1040 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -3276,11 +3276,6 @@ router_add_to_routerlist(routerinfo_t *router, const char **msg,
* the list. */
routerlist_insert(routerlist, router);
if (!from_cache) {
- if (authdir) {
- /* launch an immediate reachability test, so we will have an opinion
- * soon in case we're generating a consensus soon */
- dirserv_single_reachability_test(time(NULL), router);
- }
signed_desc_append_to_journal(&router->cache_info,
&routerlist->desc_store);
}
@@ -3600,15 +3595,19 @@ routerlist_remove_old_routers(void)
/** We just added a new set of descriptors. Take whatever extra steps
* we need. */
-static void
+void
routerlist_descriptors_added(smartlist_t *sl, int from_cache)
{
tor_assert(sl);
control_event_descriptors_changed(sl);
- SMARTLIST_FOREACH(sl, routerinfo_t *, ri,
+ SMARTLIST_FOREACH_BEGIN(sl, routerinfo_t *, ri) {
if (ri->purpose == ROUTER_PURPOSE_BRIDGE)
learned_bridge_descriptor(ri, from_cache);
- );
+ if (ri->needs_retest_if_added) {
+ ri->needs_retest_if_added = 0;
+ dirserv_single_reachability_test(approx_time(), ri);
+ }
+ } SMARTLIST_FOREACH_END(ri);
}
/**