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.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index 160f340dc..a32cae6e9 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -2838,6 +2838,13 @@ routerlist_insert(routerlist_t *rl, routerinfo_t *ri)
ri->cache_info.signed_descriptor_digest,
&(ri->cache_info));
if (sd_old) {
+ int idx = sd_old->routerlist_index;
+ sd_old->routerlist_index = -1;
+ smartlist_del(rl->old_routers, idx);
+ if (idx < smartlist_len(rl->old_routers)) {
+ signed_descriptor_t *d = smartlist_get(rl->old_routers, idx);
+ d->routerlist_index = idx;
+ }
rl->desc_store.bytes_dropped += sd_old->signed_descriptor_len;
sdmap_remove(rl->desc_by_eid_map, sd_old->extra_info_digest);
signed_descriptor_free(sd_old);
@@ -5082,7 +5089,7 @@ router_reset_descriptor_download_failures(void)
/** Any changes in a router descriptor's publication time larger than this are
* automatically non-cosmetic. */
-#define ROUTER_MAX_COSMETIC_TIME_DIFFERENCE (12*60*60)
+#define ROUTER_MAX_COSMETIC_TIME_DIFFERENCE (2*60*60)
/** We allow uptime to vary from how much it ought to be by this much. */
#define ROUTER_ALLOW_UPTIME_DRIFT (6*60*60)