mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-24 12:23:32 +01:00
Correct moribund logic about caching v2 networkstatuses
This commit is contained in:
parent
194cc24792
commit
404e3dd481
@ -1478,7 +1478,6 @@ dirserv_set_cached_networkstatus_v2(const char *networkstatus,
|
||||
time_t published)
|
||||
{
|
||||
cached_dir_t *d, *old_d;
|
||||
const smartlist_t *trusted_dirs;
|
||||
if (!cached_v2_networkstatus)
|
||||
cached_v2_networkstatus = digestmap_new();
|
||||
|
||||
@ -1501,9 +1500,9 @@ dirserv_set_cached_networkstatus_v2(const char *networkstatus,
|
||||
}
|
||||
|
||||
/* Now purge old entries. */
|
||||
trusted_dirs = router_get_trusted_dir_servers();
|
||||
|
||||
if (digestmap_size(cached_v2_networkstatus) >
|
||||
smartlist_len(trusted_dirs) + MAX_UNTRUSTED_NETWORKSTATUSES) {
|
||||
get_n_authorities(V2_DIRINFO) + MAX_UNTRUSTED_NETWORKSTATUSES) {
|
||||
/* We need to remove the oldest untrusted networkstatus. */
|
||||
const char *oldest = NULL;
|
||||
time_t oldest_published = TIME_MAX;
|
||||
|
Loading…
Reference in New Issue
Block a user