summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/or/routerlist.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index 2faa36e207..6e5c8b7d6d 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -1893,6 +1893,7 @@ routerlist_insert(routerlist_t *rl, routerinfo_t *ri)
routerinfo_t *ri_generated = router_get_my_routerinfo();
tor_assert(ri_generated != ri);
}
+ tor_assert(ri->routerlist_index == -1);
ri_old = digestmap_set(rl->identity_map, ri->cache_info.identity_digest, ri);
tor_assert(!ri_old);
@@ -1981,6 +1982,8 @@ routerlist_insert_old(routerlist_t *rl, routerinfo_t *ri)
routerinfo_t *ri_generated = router_get_my_routerinfo();
tor_assert(ri_generated != ri);
}
+ tor_assert(ri->routerlist_index == -1);
+
if (get_options()->DirPort &&
ri->purpose == ROUTER_PURPOSE_GENERAL &&
!digestmap_get(rl->desc_digest_map,
@@ -2113,6 +2116,8 @@ routerlist_replace(routerlist_t *rl, routerinfo_t *ri_old,
tor_assert(ri_generated != ri_new);
}
tor_assert(ri_old != ri_new);
+ tor_assert(ri_new->routerlist_index == -1);
+
idx = _routerlist_find_elt(rl->routers, ri_old, idx);
router_dir_info_changed();
if (idx >= 0) {