From ec49905fb8e050ffcdb46f461a96b42fb57e9b45 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Wed, 10 Nov 2004 19:32:44 +0000 Subject: [PATCH] When we think we have no bandwidth, guess that we will run for 1 day. svn:r2795 --- src/or/hibernate.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/or/hibernate.c b/src/or/hibernate.c index 281d60563e..0eebd74fe3 100644 --- a/src/or/hibernate.c +++ b/src/or/hibernate.c @@ -285,8 +285,11 @@ accounting_set_wakeup_time(void) crypto_digest_get_digest(d, digest, DIGEST_LEN); crypto_free_digest_env(d); - n_days_to_exhaust_bw = - (get_options()->AccountingMaxKB/expected_bandwidth_usage)/(24*60); + if (expected_bandwidth_usage) + n_days_to_exhaust_bw = + (get_options()->AccountingMaxKB/expected_bandwidth_usage)/(24*60); + else + n_days_to_exhaust_bw = 1; tm = gmtime(&interval_start_time); if (++tm->tm_mon > 11) { tm->tm_mon = 0; ++tm->tm_year; } -- 2.47.3