summaryrefslogtreecommitdiff
path: root/src/leap/gui/statuspanel.py
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2013-08-02 14:49:58 -0300
committerTomás Touceda <chiiph@leap.se>2013-08-02 14:49:58 -0300
commitd2d13cf61adf51895d45556ab0b08115ea2eeb1c (patch)
tree9bf6dbd65b8250c762b2409886e025aec7ec4a42 /src/leap/gui/statuspanel.py
parenta3c23acaf45b81a6360cd76180c7329a7369b4c5 (diff)
parent9bc0b0b8508da85b90cb3390b0bc92410a53acfe (diff)
Merge remote-tracking branch 'ivan/bug/3274_fix-negative-rates' into develop
Diffstat (limited to 'src/leap/gui/statuspanel.py')
-rw-r--r--src/leap/gui/statuspanel.py5
1 files changed, 5 insertions, 0 deletions
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):