Sync store's clear_sync_info doesn't need to be async (#16528)

This commit is contained in:
Amine Khaldi
2023-10-10 09:55:45 -05:00
committed by GitHub
parent aeeced6117
commit d2abc99f98
3 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -1248,7 +1248,7 @@ class FullNode:
return None
async with self.blockchain.priority_mutex.acquire(priority=BlockchainMutexPriority.high):
await self.sync_store.clear_sync_info()
self.sync_store.clear_sync_info()
peak: Optional[BlockRecord] = self.blockchain.get_peak()
peak_fb: Optional[FullBlock] = await self.blockchain.get_full_peak()
@@ -1709,7 +1709,7 @@ class FullNode:
self.full_node_store.clear_candidate_blocks_below(clear_height)
self.full_node_store.clear_unfinished_blocks_below(clear_height)
if peak.height % 1000 == 0 and not self.sync_store.get_sync_mode():
await self.sync_store.clear_sync_info() # Occasionally clear sync peer info
self.sync_store.clear_sync_info() # Occasionally clear sync peer info
state_changed_data: Dict[str, Any] = {
"transaction_block": False,
+1 -1
View File
@@ -120,7 +120,7 @@ class SyncStore:
assert heaviest_peak is not None
return heaviest_peak
async def clear_sync_info(self) -> None:
def clear_sync_info(self) -> None:
"""
Clears the peak_to_peer info which can get quite large.
"""
@@ -19,7 +19,7 @@ async def test_basic_store():
assert sync_mode == store.get_sync_mode()
# clear sync info
await store.clear_sync_info()
store.clear_sync_info()
peer_ids = [std_hash(bytes([a])) for a in range(3)]