mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 15:19:07 +01:00
init: don't start indexes sync thread prematurely
By moving the 'StartIndexes()' call into the 'initload' thread, we can remove the threads active wait. Optimizing the available resources. The only difference with the current state is that now the indexes threads will only be started when they can process work and not before it.
This commit is contained in:
@@ -163,12 +163,6 @@ static const CBlockIndex* NextSyncBlock(const CBlockIndex* pindex_prev, CChain&
|
||||
|
||||
void BaseIndex::ThreadSync()
|
||||
{
|
||||
// Wait for a possible reindex-chainstate to finish until continuing
|
||||
// with the index sync
|
||||
while (!g_indexes_ready_to_sync) {
|
||||
if (!m_interrupt.sleep_for(std::chrono::milliseconds(500))) return;
|
||||
}
|
||||
|
||||
const CBlockIndex* pindex = m_best_block_index.load();
|
||||
if (!m_synced) {
|
||||
std::chrono::steady_clock::time_point last_log_time{0s};
|
||||
|
||||
Reference in New Issue
Block a user