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
def hash(self): return Crypto.proofOfWorkHash(self.serializeHeader())