diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-08-23 10:22:51 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-08-23 10:22:51 -0400 |
commit | 86ee35ad5b5240b16d3f231f66f744ce7cc3c293 (patch) | |
tree | 76e090ad1079c7a95b02e1f5b1032fa7196b5b1a | |
parent | 10b242822490c9873138565bcc8a3565a7dc7014 (diff) | |
download | tor-86ee35ad5b5240b16d3f231f66f744ce7cc3c293.tar.gz tor-86ee35ad5b5240b16d3f231f66f744ce7cc3c293.zip |
Don't do expensive consensus stuff when not a cache.
This includes generating and storing compressed consensuses, and
consensus diffs. Fixes bug 23275; bugfix on 0.3.1.1-alpha.
-rw-r--r-- | changes/bug23275 | 5 | ||||
-rw-r--r-- | src/or/main.c | 2 | ||||
-rw-r--r-- | src/or/networkstatus.c | 2 |
3 files changed, 7 insertions, 2 deletions
diff --git a/changes/bug23275 b/changes/bug23275 new file mode 100644 index 0000000000..d6c3c47743 --- /dev/null +++ b/changes/bug23275 @@ -0,0 +1,5 @@ + o Minor bugfixes (relay): + - When a relay is not running as a directory cache, it will no longer + generate compressed consensuses and consensus diff information. + Previously, this was a waste of disk and CPU. Fixes bug 23275; + bugfix on 0.3.1.1-alpha. diff --git a/src/or/main.c b/src/or/main.c index cb24fd18c8..7b1f4975f7 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -1487,7 +1487,7 @@ run_scheduled_events(time_t now) /* 12. launch diff computations. (This is free if there are none to * launch.) */ - if (server_mode(options)) { + if (dir_server_mode(options)) { consdiffmgr_rescan(); } } diff --git a/src/or/networkstatus.c b/src/or/networkstatus.c index 25d79139b9..997280de52 100644 --- a/src/or/networkstatus.c +++ b/src/or/networkstatus.c @@ -2014,7 +2014,7 @@ networkstatus_set_current_consensus(const char *consensus, &c->digests, c->digest_sha3_as_signed, c->valid_after); - if (server_mode(get_options())) { + if (dir_server_mode(get_options())) { consdiffmgr_add_consensus(consensus, c); } } |