def analyseBlock(self, block):
signerPublicKey = self.network.getNodePublicKey(block.node)
try:
pkcs1_15.new(signerPublicKey).verify(SHA256.new(block.hash.encode('utf-8')), block.signature)
except (ValueError, TypeError):
return False
if block.hash[:block.threshold] != '0'*block.threshold:
return False
if block.flags == 0x11:
if not reduce(lambda x, y: x and y, map(self.verifyTransaction, block.transactions)):
return False
return True
#listening service corresponding to getForkedBlocks
评论列表
文章目录