aboutsummaryrefslogtreecommitdiff
path: root/src/or/rephist.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/or/rephist.c')
-rw-r--r--src/or/rephist.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/or/rephist.c b/src/or/rephist.c
index 0790084597..d31161ca07 100644
--- a/src/or/rephist.c
+++ b/src/or/rephist.c
@@ -751,6 +751,8 @@ rep_hist_load_state(or_state_t *state, char **err)
return 0;
}
+/*********************************************************************/
+
/** A list of port numbers that have been used recently. */
static smartlist_t *predicted_ports_list=NULL;
/** The corresponding most recently used time for each port. */
@@ -912,6 +914,15 @@ rep_hist_get_predicted_internal(time_t now, int *need_uptime,
return 1;
}
+/** Return 1 if we have no need for circuits currently, else return 0. */
+int
+rep_hist_circbuilding_dormant(void)
+{
+ if (predicted_ports_list || predicted_internal_time)
+ return 0; /* nothing used lately. */
+ return 1;
+}
+
/** Free all storage held by the OR/link history caches, by the
* bandwidth history arrays, or by the port history. */
void