aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2005-12-27 05:58:12 +0000
committerNick Mathewson <nickm@torproject.org>2005-12-27 05:58:12 +0000
commitfa0d5aa89408c0f84f41e0126d50ac472bddfc84 (patch)
tree87f9276e2e6e9fb1493e3549a6f9fa725b9868f6 /src
parentece98650204f825db1df2b9fa25c985d00049314 (diff)
downloadtor-fa0d5aa89408c0f84f41e0126d50ac472bddfc84.tar.gz
tor-fa0d5aa89408c0f84f41e0126d50ac472bddfc84.zip
Make insert_old try hard to never add a duplicate.
svn:r5661
Diffstat (limited to 'src')
-rw-r--r--src/or/routerlist.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index d3bb3c4c0c..7fc1808b4d 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -1226,7 +1226,9 @@ routerlist_insert(routerlist_t *rl, routerinfo_t *ri)
static void
routerlist_insert_old(routerlist_t *rl, routerinfo_t *ri)
{
- if (get_options()->DirPort) {
+ if (get_options()->DirPort &&
+ !digestmap_get(rl->desc_digest_map,
+ ri->cache_info.signed_descriptor_digest)) {
signed_descriptor_t *sd = signed_descriptor_from_routerinfo(ri);
digestmap_set(rl->desc_digest_map, sd->signed_descriptor_digest, sd);
smartlist_add(rl->old_routers, sd);