diff options
author | Roger Dingledine <arma@torproject.org> | 2005-01-11 11:54:11 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2005-01-11 11:54:11 +0000 |
commit | 70b3208f0aabf8952e6cf461fba88edc8ea699b8 (patch) | |
tree | 05a41f5c7b0df65c9fb3bf58ba4bf722bec9b437 /src | |
parent | 45eb8d9660681ef0f948c4c22d38fc4319aa000e (diff) | |
download | tor-70b3208f0aabf8952e6cf461fba88edc8ea699b8.tar.gz tor-70b3208f0aabf8952e6cf461fba88edc8ea699b8.zip |
if somebody starts his tor server in jan 2004 and then fixes his
clock, don't make his published uptime be a year.
svn:r3337
Diffstat (limited to 'src')
-rw-r--r-- | src/or/main.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/or/main.c b/src/or/main.c index 107007f60f..f83c26381a 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -765,7 +765,9 @@ static int prepare_for_poll(void) { stats_prev_global_read_bucket = global_read_bucket; stats_prev_global_write_bucket = global_write_bucket; - stats_n_seconds_working += seconds_elapsed; + /* if more than 10s have elapsed, probably the clock changed: doesn't count. */ + if (seconds_elapsed < 10) + stats_n_seconds_working += seconds_elapsed; assert_all_pending_dns_resolves_ok(); run_scheduled_events(now.tv_sec); |