aboutsummaryrefslogtreecommitdiff
path: root/src/or/networkstatus.c
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2018-01-31 13:59:05 -0500
committerDavid Goulet <dgoulet@torproject.org>2018-01-31 13:59:05 -0500
commitc85f78e74c52d19b575618d031e67b64210c14fc (patch)
tree1ea73761ab53e346d34e7a793b8b4ee0c0da18ab /src/or/networkstatus.c
parent3a247ca92a06c864a2cb634fbe2bc23cf48fb977 (diff)
downloadtor-c85f78e74c52d19b575618d031e67b64210c14fc.tar.gz
tor-c85f78e74c52d19b575618d031e67b64210c14fc.zip
Revert "ns: Call notify_networkstatus_changed() after the new consensus is set globally"
This reverts commit 3a247ca92a06c864a2cb634fbe2bc23cf48fb977.
Diffstat (limited to 'src/or/networkstatus.c')
-rw-r--r--src/or/networkstatus.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/or/networkstatus.c b/src/or/networkstatus.c
index 4ae114f35f..e0a3e4cdc6 100644
--- a/src/or/networkstatus.c
+++ b/src/or/networkstatus.c
@@ -1564,11 +1564,7 @@ notify_control_networkstatus_changed(const networkstatus_t *old_c,
smartlist_free(changed);
}
-/* Called when the consensus has changed from old_c to new_c.
- *
- * IMPORTANT: This is called _after_ the new consensus has been set in the
- * global state so this is safe for anything getting the latest consensus from
- * that state. */
+/* Called when the consensus has changed from old_c to new_c. */
static void
notify_networkstatus_changed(const networkstatus_t *old_c,
const networkstatus_t *new_c)
@@ -1901,6 +1897,9 @@ networkstatus_set_current_consensus(const char *consensus,
const int is_usable_flavor = flav == usable_consensus_flavor();
+ if (is_usable_flavor) {
+ notify_networkstatus_changed(networkstatus_get_latest_consensus(), c);
+ }
if (flav == FLAV_NS) {
if (current_ns_consensus) {
networkstatus_copy_old_consensus_info(c, current_ns_consensus);
@@ -1923,13 +1922,6 @@ networkstatus_set_current_consensus(const char *consensus,
free_consensus = 0; /* avoid free */
}
- /* Called _after_ the consensus is set in its global variable so any
- * functions called from this notification can safely get the latest
- * consensus being the new one. */
- if (is_usable_flavor) {
- notify_networkstatus_changed(networkstatus_get_latest_consensus(), c);
- }
-
waiting = &consensus_waiting_for_certs[flav];
if (waiting->consensus &&
waiting->consensus->valid_after <= c->valid_after) {