diff options
author | Nick Mathewson <nickm@torproject.org> | 2008-09-30 13:59:12 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2008-09-30 13:59:12 +0000 |
commit | ccede03cc045ae87b49bdcf3caaa943f7c07addb (patch) | |
tree | 2fd3b82f8ccab9fd26530df323daeebcdd28d0a7 /src/or | |
parent | ce5d2bc5fb32bf822103b584d5934e57d8527cec (diff) | |
download | tor-ccede03cc045ae87b49bdcf3caaa943f7c07addb.tar.gz tor-ccede03cc045ae87b49bdcf3caaa943f7c07addb.zip |
Switch a should-benee-dless check for an assert.
svn:r17018
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/rephist.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/or/rephist.c b/src/or/rephist.c index 5d9ce14a01..088635cda4 100644 --- a/src/or/rephist.c +++ b/src/or/rephist.c @@ -293,13 +293,15 @@ rep_hist_note_router_reachable(const char *id, time_t when) int was_in_run = 1; char tbuf[ISO_TIME_LEN+1]; + tor_assert(hist); + if (!started_tracking_stability) started_tracking_stability = time(NULL); - if (hist && !hist->start_of_run) { + if (!hist->start_of_run) { hist->start_of_run = when; was_in_run = 0; } - if (hist && hist->start_of_downtime) { + if (hist->start_of_downtime) { long down_length; format_local_iso_time(tbuf, hist->start_of_downtime); @@ -332,7 +334,9 @@ rep_hist_note_router_unreachable(const char *id, time_t when) int was_running = 0; if (!started_tracking_stability) started_tracking_stability = time(NULL); - if (hist && hist->start_of_run) { + + tor_assert(hist); + if (hist->start_of_run) { /*XXXX We could treat failed connections differently from failed * connect attempts. */ long run_length = when - hist->start_of_run; @@ -350,7 +354,7 @@ rep_hist_note_router_unreachable(const char *id, time_t when) hex_str(id, DIGEST_LEN), tbuf, hist->weighted_uptime, hist->total_weighted_time); } - if (hist && !hist->start_of_downtime) { + if (!hist->start_of_downtime) { hist->start_of_downtime = when; if (!was_running) |