made share with invalid PoW ban peer
authorForrest Voight <forrest@forre.st>
Fri, 16 Mar 2012 18:48:07 +0000 (14:48 -0400)
committerForrest Voight <forrest@forre.st>
Fri, 16 Mar 2012 18:48:07 +0000 (14:48 -0400)
p2pool/data.py

index 875d631..885b406 100644 (file)
@@ -229,9 +229,7 @@ class Share(object):
         self.header_hash = bitcoin_data.hash256(bitcoin_data.block_header_type.pack(self.header))
         
         if self.pow_hash > self.target:
-            print 'hash %x' % self.pow_hash
-            print 'targ %x' % self.target
-            raise ValueError('not enough work!')
+            raise p2p.PeerMisbehavingError('share PoW invalid')
         
         if other_txs is not None and not self.pow_hash <= self.header['bits'].target:
             raise ValueError('other_txs provided when not a block solution')