aboutsummaryrefslogtreecommitdiff
path: root/src/index
diff options
context:
space:
mode:
authorfurszy <matiasfurszyfer@protonmail.com>2023-05-17 16:06:55 -0300
committerfurszy <matiasfurszyfer@protonmail.com>2023-07-10 10:50:50 -0300
commitfcbdaeef4d5a63e3e5b479c6fcad730eb86fb923 (patch)
treee266b0cab828adc38232b388fd6bd3ff0538bdd7 /src/index
parent2ec89f1970935d27631bcd17b7923a79cdb1edbb (diff)
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.
Diffstat (limited to 'src/index')
-rw-r--r--src/index/base.cpp6
1 files changed, 0 insertions, 6 deletions
diff --git a/src/index/base.cpp b/src/index/base.cpp
index 8accc2a6a4..1babfacb15 100644
--- a/src/index/base.cpp
+++ b/src/index/base.cpp
@@ -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};