Store only fully verified blocks in the cache
This commit is contained in:
@@ -441,6 +441,9 @@ void SideChain::add_block(const PoolBlock& block)
|
||||
", verified = " << (block.m_verified ? 1 : 0)
|
||||
);
|
||||
|
||||
// Save it for faster syncing on the next p2pool start
|
||||
m_pool->p2p_server()->store_in_cache(block);
|
||||
|
||||
PoolBlock* new_block = new PoolBlock(block);
|
||||
|
||||
MutexLock lock(m_sidechainLock);
|
||||
@@ -816,6 +819,9 @@ void SideChain::verify_loop(PoolBlock* block)
|
||||
}
|
||||
}
|
||||
|
||||
// Save it for faster syncing on the next p2pool start
|
||||
m_pool->p2p_server()->store_in_cache(*block);
|
||||
|
||||
// Try to verify blocks on top of this one
|
||||
for (size_t i = 1; i <= UNCLE_BLOCK_DEPTH; ++i) {
|
||||
auto it = m_blocksByHeight.find(block->m_sidechainHeight + i);
|
||||
|
||||
Reference in New Issue
Block a user