From 9bc0b0b8508da85b90cb3390b0bc92410a53acfe Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Fri, 2 Aug 2013 14:33:58 -0300 Subject: Bugfix, avoid getting negative rates. Closes #3274 --- src/leap/gui/statuspanel.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/leap') diff --git a/src/leap/gui/statuspanel.py b/src/leap/gui/statuspanel.py index 7c824e01..f3424c7c 100644 --- a/src/leap/gui/statuspanel.py +++ b/src/leap/gui/statuspanel.py @@ -86,6 +86,11 @@ class RateMovingAverage(object): rate = float(deltatraffic) / float(deltat) / 1024 except ZeroDivisionError: rate = 0 + + # In some cases we get negative rates + if rate < 0: + rate = 0 + return rate def get_total(self): -- cgit v1.2.3