From 13c3884ff60aa0e58464f379f988683f1c30438a Mon Sep 17 00:00:00 2001 From: Sebastian Hahn Date: Tue, 19 Apr 2011 17:12:27 +0200 Subject: Don't sometimes undercount bw average This fixes the first part of bug 2704. It should occur only rarely when no bw maxima are known. Bugfix on 0.2.2.23-alpha. Fixes bug 2704. --- src/or/rephist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/or/rephist.c') diff --git a/src/or/rephist.c b/src/or/rephist.c index 9b7eefecf2..6034bbcb2b 100644 --- a/src/or/rephist.c +++ b/src/or/rephist.c @@ -1673,7 +1673,7 @@ rep_hist_load_bwhist_state_section(bw_array_t *b, mv *= NUM_SECS_ROLLING_MEASURE; } else { /* No maxima known; guess average rate to be conservative. */ - mv = v / s_interval; + mv = (v / s_interval) * NUM_SECS_ROLLING_MEASURE; } if (!ok) { retval = -1; -- cgit v1.2.3-54-g00ecf