summaryrefslogtreecommitdiff
path: root/src/or/networkstatus.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-02-16 09:41:06 -0500
committerNick Mathewson <nickm@torproject.org>2018-02-16 09:41:06 -0500
commitcb92d47deca15c44dd52cad6fc326520648c632e (patch)
tree4a13531c5add07457232ad2d112e0cc17d2a7da6 /src/or/networkstatus.c
parent2b99350ca4c905db1bd4f1aecc630b4f55933e96 (diff)
parente7f631478254c38d6d8b1bea65840b4c6429e4f4 (diff)
downloadtor-cb92d47deca15c44dd52cad6fc326520648c632e.tar.gz
tor-cb92d47deca15c44dd52cad6fc326520648c632e.zip
Merge remote-tracking branch 'dgoulet/ticket24902_029_05' into maint-0.2.9
Diffstat (limited to 'src/or/networkstatus.c')
-rw-r--r--src/or/networkstatus.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/or/networkstatus.c b/src/or/networkstatus.c
index 991cf80121..d9ae32560e 100644
--- a/src/or/networkstatus.c
+++ b/src/or/networkstatus.c
@@ -23,6 +23,7 @@
#include "directory.h"
#include "dirserv.h"
#include "dirvote.h"
+#include "dos.h"
#include "entrynodes.h"
#include "main.h"
#include "microdesc.h"
@@ -1502,6 +1503,15 @@ notify_control_networkstatus_changed(const networkstatus_t *old_c,
smartlist_free(changed);
}
+/* 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)
+{
+ notify_control_networkstatus_changed(old_c, new_c);
+ dos_consensus_has_changed(new_c);
+}
+
/** Copy all the ancillary information (like router download status and so on)
* from <b>old_c</b> to <b>new_c</b>. */
static void
@@ -1826,8 +1836,7 @@ networkstatus_set_current_consensus(const char *consensus,
const int is_usable_flavor = flav == usable_consensus_flavor();
if (is_usable_flavor) {
- notify_control_networkstatus_changed(
- networkstatus_get_latest_consensus(), c);
+ notify_networkstatus_changed(networkstatus_get_latest_consensus(), c);
}
if (flav == FLAV_NS) {
if (current_ns_consensus) {