P2PServer: delete old cached blocks after initial sync

Saves ~20 MB of memory
This commit is contained in:
SChernykh
2021-10-01 15:21:32 +02:00
parent 00281fb006
commit 2a3cd13b19
7 changed files with 48 additions and 9 deletions
+4
View File
@@ -1552,6 +1552,10 @@ void SideChain::prune_old_blocks()
if (num_blocks_pruned) {
LOGINFO(4, "pruned " << num_blocks_pruned << " old blocks at heights <= " << h);
// If side-chain started pruning blocks it means the initial sync is complete
// It's now safe to delete cached blocks
m_pool->p2p_server()->clear_cached_blocks();
}
}