aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-09-28 14:14:31 -0400
committerNick Mathewson <nickm@torproject.org>2011-09-28 14:19:39 -0400
commit6201b8b361fb56d9d488cea4ed47d5e0819d94b8 (patch)
treefa42ef9029af64af7ccf2929eb1148572999feeb /src
parent4a10845075d14df285e52ea4bdd72ff12c10c959 (diff)
downloadtor-6201b8b361fb56d9d488cea4ed47d5e0819d94b8.tar.gz
tor-6201b8b361fb56d9d488cea4ed47d5e0819d94b8.zip
Make sure the microdesc cache is loaded before setting a v3 md consensus
Otherwise, we can wind up munging our reference counts if we set it in the middle of loading the nodes. This happens because nodelist_set_consensus() and microdesc_reload_cache() are both in the business of adjusting microdescriptors' references.
Diffstat (limited to 'src')
-rw-r--r--src/or/nodelist.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/or/nodelist.c b/src/or/nodelist.c
index 39bc082450..b93b919c13 100644
--- a/src/or/nodelist.c
+++ b/src/or/nodelist.c
@@ -177,7 +177,10 @@ nodelist_set_consensus(networkstatus_t *ns)
{
const or_options_t *options = get_options();
int authdir = authdir_mode_v2(options) || authdir_mode_v3(options);
+
init_nodelist();
+ if (ns->flavor == FLAV_MICRODESC)
+ (void) get_microdesc_cache(); /* Make sure it exists first. */
SMARTLIST_FOREACH(the_nodelist->nodes, node_t *, node,
node->rs = NULL);