summaryrefslogtreecommitdiff
path: root/src/core/mainloop
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-12-04 12:07:23 -0500
committerNick Mathewson <nickm@torproject.org>2018-12-04 12:08:24 -0500
commit4f558843151f0c49c077d3d9a1cd8a187904a024 (patch)
tree2dd9994fd527fc219d099d491dba2e4491009362 /src/core/mainloop
parentb25b8150c282c28d3fa23330891fda7adbbfe584 (diff)
downloadtor-4f558843151f0c49c077d3d9a1cd8a187904a024.tar.gz
tor-4f558843151f0c49c077d3d9a1cd8a187904a024.zip
Add an option to start tor in dormant mode for the first time.
Diffstat (limited to 'src/core/mainloop')
-rw-r--r--src/core/mainloop/netstatus.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/core/mainloop/netstatus.c b/src/core/mainloop/netstatus.c
index 59fd8f8037..2426baae34 100644
--- a/src/core/mainloop/netstatus.c
+++ b/src/core/mainloop/netstatus.c
@@ -129,8 +129,14 @@ netstatus_load_from_state(const or_state_t *state, time_t now)
{
time_t last_activity;
if (state->Dormant == -1) { // Initial setup.
- last_activity = now;
- participating_on_network = true;
+ if (get_options()->DormantOnFirstStartup) {
+ last_activity = 0;
+ participating_on_network = false;
+ } else {
+ // Start up as active, treat activity as happening now.
+ last_activity = now;
+ participating_on_network = true;
+ }
} else if (state->Dormant) {
last_activity = 0;
participating_on_network = false;