diff --git a/src/init.cpp b/src/init.cpp index 988976028dd..545f6068d9f 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1657,7 +1657,10 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info) } chainman.m_load_block = std::thread(&util::TraceThread, "loadblk", [=, &chainman, &args] { - ThreadImport(chainman, vImportFiles, ShouldPersistMempool(args) ? MempoolPath(args) : fs::path{}); + // Import blocks + ThreadImport(chainman, vImportFiles); + // Load mempool from disk + chainman.ActiveChainstate().LoadMempool(ShouldPersistMempool(args) ? MempoolPath(args) : fs::path{}); }); // Wait for genesis block to be processed diff --git a/src/node/blockstorage.cpp b/src/node/blockstorage.cpp index 191b6dc2f5f..461ec10f66c 100644 --- a/src/node/blockstorage.cpp +++ b/src/node/blockstorage.cpp @@ -868,7 +868,7 @@ public: } }; -void ThreadImport(ChainstateManager& chainman, std::vector vImportFiles, const fs::path& mempool_path) +void ThreadImport(ChainstateManager& chainman, std::vector vImportFiles) { ScheduleBatchPriority(); @@ -939,7 +939,7 @@ void ThreadImport(ChainstateManager& chainman, std::vector vImportFile return; } } // End scope of ImportingNow - chainman.ActiveChainstate().LoadMempool(mempool_path); + g_indexes_ready_to_sync = true; } } // namespace node diff --git a/src/node/blockstorage.h b/src/node/blockstorage.h index 36b8aa48061..4895e582e90 100644 --- a/src/node/blockstorage.h +++ b/src/node/blockstorage.h @@ -255,7 +255,7 @@ public: void CleanupBlockRevFiles() const; }; -void ThreadImport(ChainstateManager& chainman, std::vector vImportFiles, const fs::path& mempool_path); +void ThreadImport(ChainstateManager& chainman, std::vector vImportFiles); } // namespace node #endif // BITCOIN_NODE_BLOCKSTORAGE_H