aboutsummaryrefslogtreecommitdiff
path: root/src/init.cpp
diff options
context:
space:
mode:
authorfurszy <matiasfurszyfer@protonmail.com>2023-06-17 11:11:51 -0300
committerfurszy <matiasfurszyfer@protonmail.com>2023-07-07 19:31:27 -0300
commit04575106b2529f495ce8110ddf7ed2247d4bc339 (patch)
tree589bc75b1a85ec31b86de84d8eeb96f4635bbcb7 /src/init.cpp
parented4462cc78afd2065bbf5bd79728852b65b9ad7f (diff)
scripted-diff: rename 'loadblk' thread name to 'initload'
The thread does not only load blocks, it loads the mempool and, in a future commit, will start the indexes as well. Also, renamed the 'ThreadImport' function to 'ImportBlocks' And the 'm_load_block' class member to 'm_thread_load'. -BEGIN VERIFY SCRIPT- sed -i "s/ThreadImport/ImportBlocks/g" $(git grep -l ThreadImport -- ':!/doc/') sed -i "s/loadblk/initload/g" $(git grep -l loadblk -- ':!/doc/release-notes/') sed -i "s/m_load_block/m_thread_load/g" $(git grep -l m_load_block) -END VERIFY SCRIPT-
Diffstat (limited to 'src/init.cpp')
-rw-r--r--src/init.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 545f6068d9..80205df000 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -131,7 +131,7 @@ using node::LoadChainstate;
using node::MempoolPath;
using node::NodeContext;
using node::ShouldPersistMempool;
-using node::ThreadImport;
+using node::ImportBlocks;
using node::VerifyLoadedChainstate;
static constexpr bool DEFAULT_PROXYRANDOMIZE{true};
@@ -268,7 +268,7 @@ void Shutdown(NodeContext& node)
// After everything has been shut down, but before things get flushed, stop the
// CScheduler/checkqueue, scheduler and load block thread.
if (node.scheduler) node.scheduler->stop();
- if (node.chainman && node.chainman->m_load_block.joinable()) node.chainman->m_load_block.join();
+ if (node.chainman && node.chainman->m_thread_load.joinable()) node.chainman->m_thread_load.join();
StopScriptCheckWorkerThreads();
// After the threads that potentially access these pointers have been stopped,
@@ -1545,7 +1545,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
// ********************************************************* Step 8: start indexers
- // If reindex-chainstate was specified, delay syncing indexes until ThreadImport has reindexed the chain
+ // If reindex-chainstate was specified, delay syncing indexes until ImportBlocks has reindexed the chain
if (!fReindexChainState) g_indexes_ready_to_sync = true;
if (args.GetBoolArg("-txindex", DEFAULT_TXINDEX)) {
auto result{WITH_LOCK(cs_main, return CheckLegacyTxindex(*Assert(chainman.m_blockman.m_block_tree_db)))};
@@ -1656,9 +1656,9 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
vImportFiles.push_back(fs::PathFromString(strFile));
}
- chainman.m_load_block = std::thread(&util::TraceThread, "loadblk", [=, &chainman, &args] {
+ chainman.m_thread_load = std::thread(&util::TraceThread, "initload", [=, &chainman, &args] {
// Import blocks
- ThreadImport(chainman, vImportFiles);
+ ImportBlocks(chainman, vImportFiles);
// Load mempool from disk
chainman.ActiveChainstate().LoadMempool(ShouldPersistMempool(args) ? MempoolPath(args) : fs::path{});
});
@@ -1667,7 +1667,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
{
WAIT_LOCK(g_genesis_wait_mutex, lock);
// We previously could hang here if StartShutdown() is called prior to
- // ThreadImport getting started, so instead we just wait on a timer to
+ // ImportBlocks getting started, so instead we just wait on a timer to
// check ShutdownRequested() regularly.
while (!fHaveGenesis && !ShutdownRequested()) {
g_genesis_wait_cv.wait_for(lock, std::chrono::milliseconds(500));