mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2026-09-24 23:40:01 -05:00
Sync store's clear_sync_info doesn't need to be async (#16528)
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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)]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user