示例#1
0
 def verify_block_integrity(self,blockhash,block):
     block_gen_valid(block)
     # Transactions
     for tHash,transaction in block['transactions'].items():
         verify_tx_integrity(tHash,transaction)
         tx_amounts_valid(transaction)
     return True
                 
     # Block
     if util.gen_block_hash(block) != blockhash:
         raise IntegrityException('False block: ' + blockhash)
     return True
示例#2
0
文件: Block.py 项目: zgreat/freecoin
    def verify_block_integrity(self, blockhash, block):
        block_gen_valid(block)
        # Transactions
        for tHash, transaction in block['transactions'].items():
            verify_tx_integrity(tHash, transaction)
            tx_amounts_valid(transaction)
        return True

        # Block
        if util.gen_block_hash(block) != blockhash:
            raise IntegrityException('False block: ' + blockhash)
        return True
示例#3
0
 def win(self, nonce):
     self.block['nonce'] = nonce
     self.block['solve_time'] = str(int(time()))
     self.hash = util.gen_block_hash(self.block)
示例#4
0
 def win(self,nonce):
     self.block['nonce'] = nonce
     self.block['solve_time'] = str(int(time()))
     self.hash = util.gen_block_hash(self.block)
     
     #TODO broadcast new block to IRC