mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 15:09:59 +01:00
Add local thread pool to CCheckQueue
This commit is contained in:
@@ -162,9 +162,7 @@ TestingSetup::TestingSetup(const std::string& chainName, const std::vector<const
|
||||
|
||||
// Start script-checking threads. Set g_parallel_script_checks to true so they are used.
|
||||
constexpr int script_check_threads = 2;
|
||||
for (int i = 0; i < script_check_threads; ++i) {
|
||||
threadGroup.create_thread([i]() { return ThreadScriptCheck(i); });
|
||||
}
|
||||
StartScriptCheckWorkerThreads(script_check_threads);
|
||||
g_parallel_script_checks = true;
|
||||
|
||||
m_node.banman = MakeUnique<BanMan>(GetDataDir() / "banlist.dat", nullptr, DEFAULT_MISBEHAVING_BANTIME);
|
||||
@@ -182,6 +180,7 @@ TestingSetup::~TestingSetup()
|
||||
if (m_node.scheduler) m_node.scheduler->stop();
|
||||
threadGroup.interrupt_all();
|
||||
threadGroup.join_all();
|
||||
StopScriptCheckWorkerThreads();
|
||||
GetMainSignals().FlushBackgroundCallbacks();
|
||||
GetMainSignals().UnregisterBackgroundSignalScheduler();
|
||||
m_node.connman.reset();
|
||||
|
||||
Reference in New Issue
Block a user