aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Kadianakis <desnacked@riseup.net>2018-06-14 15:38:14 +0300
committerNick Mathewson <nickm@torproject.org>2018-07-17 15:57:46 -0400
commit5fb6f656dfad3ddb178b76448742bfc3e2e834da (patch)
treece14fc668c422b4f336e50a2112db96c00c1d200 /src
parent05c362274b8d643a43f367d047699a88d30d667a (diff)
downloadtor-5fb6f656dfad3ddb178b76448742bfc3e2e834da.tar.gz
tor-5fb6f656dfad3ddb178b76448742bfc3e2e834da.zip
Use approx_time() instead of time(NULL) in some HS functions.
These were breaking our unittests.
Diffstat (limited to 'src')
-rw-r--r--src/or/hs_service.c2
-rw-r--r--src/or/voting_schedule.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/or/hs_service.c b/src/or/hs_service.c
index 76b1634561..70d9c1c6f0 100644
--- a/src/or/hs_service.c
+++ b/src/or/hs_service.c
@@ -433,7 +433,7 @@ service_intro_point_new(const extend_info_t *ei, unsigned int is_legacy)
if (BUG(intro_point_max_lifetime < intro_point_min_lifetime)) {
goto err;
}
- ip->time_to_expire = time(NULL) +
+ ip->time_to_expire = approx_time() +
crypto_rand_int_range(intro_point_min_lifetime,intro_point_max_lifetime);
}
diff --git a/src/or/voting_schedule.c b/src/or/voting_schedule.c
index 6edde3f229..8c56a10526 100644
--- a/src/or/voting_schedule.c
+++ b/src/or/voting_schedule.c
@@ -168,7 +168,7 @@ voting_schedule_get_next_valid_after_time(void)
done:
if (need_to_recalculate_voting_schedule) {
- voting_schedule_recalculate_timing(get_options(), now);
+ voting_schedule_recalculate_timing(get_options(), approx_time());
voting_schedule.created_on_demand = 1;
}