aboutsummaryrefslogtreecommitdiff
path: root/src/app/config/statefile.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/app/config/statefile.c')
-rw-r--r--src/app/config/statefile.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/app/config/statefile.c b/src/app/config/statefile.c
index 89039a05b5..fdfd68b244 100644
--- a/src/app/config/statefile.c
+++ b/src/app/config/statefile.c
@@ -34,8 +34,9 @@
#include "app/config/config.h"
#include "app/config/confparse.h"
#include "core/mainloop/mainloop.h"
+#include "core/mainloop/netstatus.h"
#include "core/mainloop/connection.h"
-#include "feature/control/control.h"
+#include "feature/control/control_events.h"
#include "feature/client/entrynodes.h"
#include "feature/hibernate/hibernate.h"
#include "feature/stats/rephist.h"
@@ -45,6 +46,7 @@
#include "app/config/statefile.h"
#include "lib/encoding/confline.h"
#include "lib/net/resolve.h"
+#include "lib/version/torversion.h"
#include "app/config/or_state_st.h"
@@ -131,6 +133,9 @@ static config_var_t state_vars_[] = {
VAR("CircuitBuildTimeBin", LINELIST_S, BuildtimeHistogram, NULL),
VAR("BuildtimeHistogram", LINELIST_V, BuildtimeHistogram, NULL),
+ V(MinutesSinceUserActivity, UINT, NULL),
+ V(Dormant, AUTOBOOL, "auto"),
+
END_OF_CONFIG_VARS
};
@@ -308,6 +313,8 @@ or_state_set(or_state_t *new_state)
get_circuit_build_times_mutable(),global_state) < 0) {
ret = -1;
}
+ netstatus_load_from_state(global_state, time(NULL));
+
return ret;
}
@@ -499,6 +506,8 @@ or_state_save(time_t now)
entry_guards_update_state(global_state);
rep_hist_update_state(global_state);
circuit_build_times_update_state(get_circuit_build_times(), global_state);
+ netstatus_flush_to_state(global_state, now);
+
if (accounting_is_enabled(get_options()))
accounting_run_housekeeping(now);