mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2026-08-24 10:05:29 -05:00
simplify Blockchain.clean_block_records() (#8879)
This commit is contained in:
@@ -729,11 +729,10 @@ class Blockchain(BlockchainInterface):
|
||||
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:
|
||||
assert self._peak_height is not None
|
||||
if self._peak_height - self.constants.BLOCKS_CACHE_SIZE < 0:
|
||||
return None
|
||||
self.clean_block_record(peak.height - self.constants.BLOCKS_CACHE_SIZE)
|
||||
self.clean_block_record(self._peak_height - self.constants.BLOCKS_CACHE_SIZE)
|
||||
|
||||
async def get_block_records_in_range(self, start: int, stop: int) -> Dict[bytes32, BlockRecord]:
|
||||
return await self.block_store.get_block_records_in_range(start, stop)
|
||||
|
||||
Reference in New Issue
Block a user