Merge commit '6fdc5de38e16be470ba83a327f764c7b649be8f2' into checkpoint/long_lived_atari_from_main_6fdc5de38e16be470ba83a327f764c7b649be8f2

This commit is contained in:
Amine Khaldi 2022-07-12 23:35:14 +01:00
commit 806d596a95
No known key found for this signature in database
GPG Key ID: B1C074FFC904E2D9
2 changed files with 4 additions and 5 deletions

View File

@ -296,8 +296,8 @@ class Blockchain(BlockchainInterface):
)
raise
# This is done outside the try-except in case it fails, since we do not want to revert anything if it does
await self.__height_map.maybe_flush()
# This is done outside the try-except in case it fails, since we do not want to revert anything if it does
await self.__height_map.maybe_flush()
if state_change_summary is not None:
# new coin records added

View File

@ -130,9 +130,8 @@ class BlockHeightMap:
def update_height(self, height: uint32, header_hash: bytes32, ses: Optional[SubEpochSummary]):
# we're only updating the last hash. If we've reorged, we already rolled
# back, making this the new peak
idx = height * 32
assert idx <= len(self.__height_to_hash)
self.__height_to_hash[idx : idx + 32] = header_hash
assert height * 32 <= len(self.__height_to_hash)
self.__set_hash(height, header_hash)
if ses is not None:
self.__sub_epoch_summaries[height] = bytes(ses)