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)
def _get_block(self, block_id): return PoetBlock(self._service.get_blocks([block_id])[block_id])
def _get_chain_head(self): return PoetBlock(self._service.get_chain_head())
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)