Example #1
0
 def validateBlockBits(self, blockHeader, bits):
     currTarget = Bits.getTargetFromBits(bits)
     blockHeaderHash = Crypto.proofOfWorkHash(blockHeader)
     blockHeaderHashLong = DataType.bytesToInt(blockHeaderHash)
     if blockHeaderHashLong < currTarget:
         return True
     else:
         return False
Example #2
0
 def hash(self):
     return Crypto.proofOfWorkHash(self.serializeHeader())