Permalink
Browse files

don't report negative hash rates when system time goes backwards

  • Loading branch information...
1 parent 7aa75ce commit 759aa69ee5b40c9349324e60aa3ce13f712fba37 @forrestv forrestv committed Feb 5, 2014
Showing with 1 addition and 1 deletion.
  1. +1 −1 p2pool/work.py
View
@@ -179,7 +179,7 @@ def preprocess_request(self, user):
def _estimate_local_hash_rate(self):
if len(self.recent_shares_ts_work) == 50:
hash_rate = sum(work for ts, work in self.recent_shares_ts_work[1:])//(self.recent_shares_ts_work[-1][0] - self.recent_shares_ts_work[0][0])
- if hash_rate:
+ if hash_rate > 0:
return hash_rate
return None

2 comments on commit 759aa69

888888

Owner

forrestv replied Mar 12, 2014

o.O

Please sign in to comment.