def clean_block_records(self):
    '\n        Cleans the cache so that we only maintain relevant blocks. This removes\n        block records that have height < peak - BLOCKS_CACHE_SIZE.\n        These blocks are necessary for calculating future difficulty adjustments.\n        '
    if (len(self.__block_records) < self.constants.BLOCKS_CACHE_SIZE):
        return None
    peak = self.get_peak()
    assert (peak is not None)
    if ((peak.height - self.constants.BLOCKS_CACHE_SIZE) < 0):
        return None
    self.clean_block_record((peak.height - self.constants.BLOCKS_CACHE_SIZE))
Cleans the cache so that we only maintain relevant blocks. This removes
block records that have height < peak - BLOCKS_CACHE_SIZE.
These blocks are necessary for calculating future difficulty adjustments.
def clean_block_records(self):
    '\n        Cleans the cache so that we only maintain relevant blocks. This removes\n        block records that have height < peak - BLOCKS_CACHE_SIZE.\n        These blocks are necessary for calculating future difficulty adjustments.\n        '
    if (len(self.__block_records) < self.constants.BLOCKS_CACHE_SIZE):
        return None
    peak = self.get_peak()
    assert (peak is not None)
    if ((peak.height - self.constants.BLOCKS_CACHE_SIZE) < 0):
        return None
    self.clean_block_record((peak.height - self.constants.BLOCKS_CACHE_SIZE))