diff options
author | Peter Palfrader <peter@palfrader.org> | 2007-04-23 19:48:13 +0000 |
---|---|---|
committer | Peter Palfrader <peter@palfrader.org> | 2007-04-23 19:48:13 +0000 |
commit | 9289e35d812897d240403797383e39f6785f99ec (patch) | |
tree | 593ce456dd28db69f4ed99105bdd90ae4ca34759 /src/or/routerlist.c | |
parent | dec649d564745241b659d378276cb2df82b6acc3 (diff) | |
download | tor-9289e35d812897d240403797383e39f6785f99ec.tar.gz tor-9289e35d812897d240403797383e39f6785f99ec.zip |
Back out backport of r9799 from the 0.1.2.x branch.
svn:r10008
Diffstat (limited to 'src/or/routerlist.c')
-rw-r--r-- | src/or/routerlist.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c index cfa2a11715..1ae5389a52 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -1588,16 +1588,11 @@ _routerlist_find_elt(smartlist_t *sl, void *ri, int idx) } /** Insert an item <b>ri</b> into the routerlist <b>rl</b>, updating indices - * as needed. There must be no previous member of <b>rl</b> with the same - * identity giest as <b>ri</b>: If there is, call routerlist_replace - * instead. - */ + * as needed. */ static void routerlist_insert(routerlist_t *rl, routerinfo_t *ri) { - routerinfo_t *ri_old; - ri_old = digestmap_set(rl->identity_map, ri->cache_info.identity_digest, ri); - tor_assert(!ri_old); + digestmap_set(rl->identity_map, ri->cache_info.identity_digest, ri); digestmap_set(rl->desc_digest_map, ri->cache_info.signed_descriptor_digest, &(ri->cache_info)); smartlist_add(rl->routers, ri); @@ -1687,7 +1682,6 @@ static void routerlist_replace(routerlist_t *rl, routerinfo_t *ri_old, routerinfo_t *ri_new, int idx, int make_old) { - routerinfo_t *ri_tmp; tor_assert(ri_old != ri_new); idx = _routerlist_find_elt(rl->routers, ri_old, idx); router_dir_info_changed(); @@ -1705,9 +1699,7 @@ routerlist_replace(routerlist_t *rl, routerinfo_t *ri_old, /* digests don't match; digestmap_set won't replace */ digestmap_remove(rl->identity_map, ri_old->cache_info.identity_digest); } - ri_tmp = digestmap_set(rl->identity_map, - ri_new->cache_info.identity_digest, ri_new); - tor_assert(!ri_tmp); + digestmap_set(rl->identity_map, ri_new->cache_info.identity_digest, ri_new); digestmap_set(rl->desc_digest_map, ri_new->cache_info.signed_descriptor_digest, &(ri_new->cache_info)); |