diff options
Diffstat (limited to 'src/init.cpp')
-rw-r--r-- | src/init.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/init.cpp b/src/init.cpp index 09eb76eaee..8e37300c99 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -223,6 +223,7 @@ void Shutdown(NodeContext& node) if (g_load_block.joinable()) g_load_block.join(); threadGroup.interrupt_all(); threadGroup.join_all(); + StopScriptCheckWorkerThreads(); // After the threads that potentially access these pointers have been stopped, // destruct and reset all to nullptr. @@ -1334,9 +1335,7 @@ bool AppInitMain(const util::Ref& context, NodeContext& node, interfaces::BlockA LogPrintf("Script verification uses %d additional threads\n", script_threads); if (script_threads >= 1) { g_parallel_script_checks = true; - for (int i = 0; i < script_threads; ++i) { - threadGroup.create_thread([i]() { return ThreadScriptCheck(i); }); - } + StartScriptCheckWorkerThreads(script_threads); } assert(!node.scheduler); |