Exemplo n.º 1
0
    def _handle_new_block(self, block):
        block = PoetBlock(block)
        LOGGER.info('Received %s', block)

        if self._check_consensus(block):
            LOGGER.info('Passed consensus check: %s', block.block_id.hex())
            self._check_block(block.block_id)
        else:
            LOGGER.info('Failed consensus check: %s', block.block_id.hex())
            self._fail_block(block.block_id)
Exemplo n.º 2
0
 def _get_block(self, block_id):
     return PoetBlock(self._service.get_blocks([block_id])[block_id])
Exemplo n.º 3
0
 def _get_chain_head(self):
     return PoetBlock(self._service.get_chain_head())
Exemplo n.º 4
0
    def _handle_new_block(self, block):
        block = PoetBlock(block)
        LOGGER.info('Received %s', block)

        self._check_block(block.block_id)
        self._validating_blocks.add(block.block_id)