def check_block(self, block):
        if self.get_block_packet_size(block) > MAX_PACKET_SIZE:
            self.logger.debug('Block failed check (block too large)')
            return False

        if not self.check_proof(block):
            # Don't log message when we created the block
            if block.creator != self.my_member.public_key:
                self.logger.debug('Block failed check (incorrect proof)')
            return False

        if not block.verify():
            self.logger.debug('Block failed check (invalid signature)')
            return False

        if self.data_manager.get_block(block.id):
            self.logger.debug('Block failed check (duplicate block)')
            return False

        if block.time > int(time.time()) + MAX_CLOCK_DRIFT:
            self.logger.debug('Block failed check (max clock drift exceeded)')
            return False

        for contract in block.contracts:
            if block.time < contract.time:
                self.logger.debug('Block failed check (block created before contract)')
                return False

            if not self.check_contract(contract):
                self.logger.warning('Block check failed (contract check failed)')
                self.incoming_contracts.pop(contract.id, None)
                return False

        if len(block.contracts) != len(set([contract.id for contract in block.contracts])):
            self.logger.debug('Block failed check (duplicate contracts)')
            return False

        if block.merkle_root_hash != block.merkle_tree.build():
            self.logger.debug('Block failed check (incorrect merkle root hash)')
            return False

        past_blocks = self.get_past_blocks(block, 11)
        if past_blocks and block.time < median([b.time for b in past_blocks]):
            self.logger.debug('Block failed check (block time smaller than median time of past 11 blocks)')
            return False

        return True