style and import fixes
authorForrest Voight <forrest@forre.st>
Sat, 10 Dec 2011 04:13:34 +0000 (23:13 -0500)
committerForrest Voight <forrest@forre.st>
Sat, 10 Dec 2011 04:13:34 +0000 (23:13 -0500)
p2pool/bitcoin/p2p.py
p2pool/p2p.py
p2pool/test/bitcoin/test_sha256.py
p2pool/test/util/test_forest.py
p2pool/util/math.py

index e3b7e8e..cc72159 100644 (file)
@@ -367,7 +367,7 @@ class HeightTracker(object):
         if last not in self._tracker.tails:
             return -1e300
         return height - max(self._tracker.get_height(head_hash) for head_hash in self._tracker.tails[last])
-     
+    
     def stop(self):
         self._factory.new_headers.unwatch(self._watch1)
         self._factory.new_block.unwatch(self._watch2)
index 0c64188..5dd6441 100644 (file)
@@ -10,7 +10,7 @@ import p2pool
 from p2pool import data as p2pool_data
 from p2pool.bitcoin import p2p as bitcoin_p2p
 from p2pool.bitcoin import data as bitcoin_data
-from p2pool.util import deferral, dicts
+from p2pool.util import deferral
 
 class Protocol(bitcoin_p2p.BaseProtocol):
     version = 2
index 16d3238..2d37bef 100644 (file)
@@ -27,12 +27,12 @@ class Test(unittest.TestCase):
         for i in xrange(100):
             test = random_str(int(random.expovariate(1/100)))
             test2 = random_str(int(random.expovariate(1/100)))
-
+            
             a = sha256.sha256(test)
             a = a.copy()
             a.update(test2)
             a = a.hexdigest()
-
+            
             b = hashlib.sha256(test)
             b = b.copy()
             b.update(test2)
index 8f70de0..8b6453c 100644 (file)
@@ -77,7 +77,7 @@ class FakeShare(object):
 
 def test_tracker(self):
     t = DumbTracker(self.shares.itervalues())
-
+    
     assert self.shares == t.shares, (self.shares, t.shares)
     assert self.reverse_shares == t.reverse_shares, (self.reverse_shares, t.reverse_shares)
     assert self.heads == t.heads, (self.heads, t.heads)
@@ -104,10 +104,10 @@ def generate_tracker_random(n):
 class Test(unittest.TestCase):
     def test_tracker(self):
         t = generate_tracker_simple(1000)
-
+        
         assert t.heads == {999: None}
         assert t.tails == {None: set([999])}
-
+        
         assert t.get_nth_parent_hash(900, 500) == 900 - 500
         assert t.get_nth_parent_hash(901, 42) == 901 - 42
     
index efc4741..6eb8303 100644 (file)
@@ -75,10 +75,10 @@ def perfect_round(x):
 def erf(x):
     # save the sign of x
     sign = 1
-    if x < 0: 
+    if x < 0:
         sign = -1
     x = abs(x)
-
+    
     # constants
     a1 =  0.254829592
     a2 = -0.284496736
@@ -86,7 +86,7 @@ def erf(x):
     a4 = -1.453152027
     a5 =  1.061405429
     p  =  0.3275911
-
+    
     # A&S formula 7.1.26
     t = 1.0/(1.0 + p*x)
     y = 1.0 - (((((a5*t + a4)*t) + a3)*t + a2)*t + a1)*t*math.exp(-x*x)