diff --git a/src/bench/checkqueue.cpp b/src/bench/checkqueue.cpp index c03457c78c..6bfe4e6d83 100644 --- a/src/bench/checkqueue.cpp +++ b/src/bench/checkqueue.cpp @@ -41,7 +41,7 @@ static void CCheckQueueSpeedPrevectorJob(benchmark::State &state) { void swap(PrevectorJob &x) { p.swap(x.p); }; }; CCheckQueue queue{QUEUE_BATCH_SIZE}; - queue.StartWorkerThreads(std::max(MIN_CORES, GetNumCores())); + queue.StartWorkerThreads(std::max(MIN_CORES, GetNumCores()) - 1); while (state.KeepRunning()) { // Make insecure_rand here so that each iteration is identical. FastRandomContext insecure_rand(true); diff --git a/src/init.cpp b/src/init.cpp index 335cb4c2e2..819afd6e34 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -2105,7 +2105,6 @@ bool AppInitMain(Config &config, RPCServer &rpcServer, LogPrintf("Script verification uses %d additional threads\n", script_threads); if (script_threads >= 1) { - g_parallel_script_checks = true; StartScriptCheckWorkerThreads(script_threads); } diff --git a/src/test/setup_common.cpp b/src/test/setup_common.cpp index 4f880e0ebf..3fd290fc06 100644 --- a/src/test/setup_common.cpp +++ b/src/test/setup_common.cpp @@ -122,10 +122,9 @@ TestingSetup::TestingSetup(const std::string &chainName) } } - // Start script-checking threads. Set g_parallel_script_checks to true so they are used. + // Start script-checking threads constexpr int script_check_threads = 2; StartScriptCheckWorkerThreads(script_check_threads); - g_parallel_script_checks = true; g_banman = std::make_unique(GetDataDir() / "banlist.dat", chainparams, diff --git a/src/validation.cpp b/src/validation.cpp index 009539274b..d5402e0597 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -260,7 +260,6 @@ CBlockIndex *pindexBestHeader = nullptr; Mutex g_best_block_mutex; std::condition_variable g_best_block_cv; uint256 g_best_block; -bool g_parallel_script_checks{false}; std::atomic_bool fImporting(false); std::atomic_bool fReindex(false); bool fHavePruned = false; @@ -1892,7 +1891,7 @@ bool CChainState::ConnectBlock(const CBlock &block, CValidationState &state, CBlockUndo blockundo; blockundo.vtxundo.resize(block.vtx.size() - 1); - CCheckQueueControl control(fScriptChecks && g_parallel_script_checks ? &scriptcheckqueue : nullptr); + CCheckQueueControl control(fScriptChecks ? &scriptcheckqueue : nullptr); // Add all outputs try { diff --git a/src/validation.h b/src/validation.h index 036db1b48b..e8aba55a7d 100644 --- a/src/validation.h +++ b/src/validation.h @@ -207,10 +207,6 @@ extern uint256 g_best_block; extern std::atomic_bool fImporting; extern std::atomic_bool fReindex; extern bool fIsBareMultisigStd; -/** Whether there are dedicated script-checking threads running. - * False indicates all script checking is done on the main threadMessageHandler thread. - */ -extern bool g_parallel_script_checks; extern bool fRequireStandard; extern bool fCheckBlockIndex; extern bool fCheckpointsEnabled;