diff options
author | Micah Elizabeth Scott <beth@torproject.org> | 2023-03-08 15:44:55 -0800 |
---|---|---|
committer | Micah Elizabeth Scott <beth@torproject.org> | 2023-05-10 07:38:28 -0700 |
commit | dcb9c4df67d116dc16f5361c8e4cd6e21fbb9abf (patch) | |
tree | e99810169c841c6cb74036d22a59dc4ccdf014a4 /src/feature/hs/hs_service.c | |
parent | 9d1a57397739b869ab102783b858889bcc2e5066 (diff) | |
download | tor-dcb9c4df67d116dc16f5361c8e4cd6e21fbb9abf.tar.gz tor-dcb9c4df67d116dc16f5361c8e4cd6e21fbb9abf.zip |
hs_pow: Make proof-of-work support optional in configure
This adds a new "pow" module for the user-visible proof
of work support in ./configure, and this disables
src/feature/hs/hs_pow at compile-time.
Signed-off-by: Micah Elizabeth Scott <beth@torproject.org>
Diffstat (limited to 'src/feature/hs/hs_service.c')
-rw-r--r-- | src/feature/hs/hs_service.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/feature/hs/hs_service.c b/src/feature/hs/hs_service.c index dd360d3659..a9070024cb 100644 --- a/src/feature/hs/hs_service.c +++ b/src/feature/hs/hs_service.c @@ -2899,7 +2899,7 @@ run_housekeeping_event(time_t now) /* Check if we need to initialize or update PoW parameters, if the * defenses are enabled. */ - if (service->config.has_pow_defenses_enabled) { + if (have_module_pow() && service->config.has_pow_defenses_enabled) { pow_housekeeping(service, now); } @@ -2937,8 +2937,10 @@ run_build_descriptor_event(time_t now) * is useful for newly built descriptors. */ update_all_descriptors_intro_points(now); - /* Update the PoW params if needed. */ - update_all_descriptors_pow_params(now); + if (have_module_pow()) { + /* Update the PoW params if needed. */ + update_all_descriptors_pow_params(now); + } } /** For the given service, launch any intro point circuits that could be |