summaryrefslogtreecommitdiff
path: root/src/or/routerlist.c
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordberg.se>2012-03-27 15:00:34 +0200
committerLinus Nordberg <linus@torproject.org>2012-07-19 18:21:20 +0200
commit631ec5c4fe4d5535d91e8e1e3597fbaa687b8790 (patch)
tree050aa6d4a7ab18ed66617412bfb31aeb709aaaf0 /src/or/routerlist.c
parent24451e6f7d6813642cc3b092bf085fdbb4a9aefc (diff)
downloadtor-631ec5c4fe4d5535d91e8e1e3597fbaa687b8790.tar.gz
tor-631ec5c4fe4d5535d91e8e1e3597fbaa687b8790.zip
Move last_reachable and testing_since from routerinfo_t to node_t.
Diffstat (limited to 'src/or/routerlist.c')
-rw-r--r--src/or/routerlist.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index de1a66ce16..f984d93e8e 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -2875,7 +2875,7 @@ routerlist_insert(routerlist_t *rl, routerinfo_t *ri)
&ri->cache_info);
smartlist_add(rl->routers, ri);
ri->cache_info.routerlist_index = smartlist_len(rl->routers) - 1;
- nodelist_add_routerinfo(ri);
+ nodelist_add_routerinfo(NULL, ri);
router_dir_info_changed();
#ifdef DEBUG_ROUTERLIST
routerlist_assert_ok(rl);
@@ -3104,8 +3104,7 @@ routerlist_replace(routerlist_t *rl, routerinfo_t *ri_old,
tor_assert(0 <= idx && idx < smartlist_len(rl->routers));
tor_assert(smartlist_get(rl->routers, idx) == ri_old);
- nodelist_remove_routerinfo(ri_old);
- nodelist_add_routerinfo(ri_new);
+ nodelist_replace_routerinfo(ri_old, ri_new);
router_dir_info_changed();
if (idx >= 0) {
@@ -3442,11 +3441,6 @@ router_add_to_routerlist(routerinfo_t *router, const char **msg,
/* Same key, and either new, or listed in the consensus. */
log_debug(LD_DIR, "Replacing entry for router %s",
router_describe(router));
- if (routers_have_same_or_addr(router, old_router)) {
- /* these carry over when the address and orport are unchanged. */
- router->last_reachable = old_router->last_reachable;
- router->testing_since = old_router->testing_since;
- }
routerlist_replace(routerlist, old_router, router);
if (!from_cache) {
signed_desc_append_to_journal(&router->cache_info,