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 before the consensus changes from old_c to new_c. */
static void
- notify_networkstatus_changed(const networkstatus_t *old_c,
- const networkstatus_t *new_c)
+ notify_before_networkstatus_changes(const networkstatus_t *old_c,
+ const networkstatus_t *new_c)
{
notify_control_networkstatus_changed(old_c, new_c);
- scheduler_notify_networkstatus_changed(old_c, new_c);
+ dos_consensus_has_changed(new_c);
}
+ /* Called after a new consensus has been put in the global state. It is safe
+ * to use the consensus getters in this function. */
+ static void
+ notify_after_networkstatus_changes(void)
+ {
+ scheduler_notify_networkstatus_changed();
+ }
+
/** Copy all the ancillary information (like router download status and so on)
* from <b>old_c</b> to <b>new_c</b>. */
static void