summaryrefslogtreecommitdiff
path: root/src/or/rephist.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2006-07-22 07:15:34 +0000
committerRoger Dingledine <arma@torproject.org>2006-07-22 07:15:34 +0000
commit2d6a4d283b5004f19c5c2c743ead51f6b2ad8440 (patch)
tree16a6d9f63a74bfc5941a546fa970b15684341e18 /src/or/rephist.c
parent444f096d2d624378514b712c78e060ab523e6cea (diff)
downloadtor-2d6a4d283b5004f19c5c2c743ead51f6b2ad8440.tar.gz
tor-2d6a4d283b5004f19c5c2c743ead51f6b2ad8440.zip
i lied, that won't work at all. maybe this will.
svn:r6805
Diffstat (limited to 'src/or/rephist.c')
-rw-r--r--src/or/rephist.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/or/rephist.c b/src/or/rephist.c
index 3d391ad94d..a9a16625c8 100644
--- a/src/or/rephist.c
+++ b/src/or/rephist.c
@@ -912,14 +912,20 @@ rep_hist_get_predicted_internal(time_t now, int *need_uptime,
return 1;
}
+/** Any ports used lately? These are pre-seeded if we just started
+ * up or if we're running a hidden service. */
+int
+any_predicted_circuits(time_t now)
+{
+ return smartlist_len(predicted_ports_list) ||
+ predicted_internal_time + PREDICTED_CIRCS_RELEVANCE_TIME >= now;
+}
+
/** Return 1 if we have no need for circuits currently, else return 0. */
int
rep_hist_circbuilding_dormant(time_t now)
{
- /* Any ports used lately? These are pre-seeded if we just started
- * up or if we're running a hidden service. */
- if (smartlist_len(predicted_ports_list) ||
- predicted_internal_time + PREDICTED_CIRCS_RELEVANCE_TIME >= now)
+ if (any_predicted_circuits(now))
return 0;
/* see if we'll still need to build testing circuits */