@@ -155,8 +155,6 @@ static fs::path GetPidFile(const ArgsManager& args)
155
155
156
156
static std::unique_ptr<ECCVerifyHandle> globalVerifyHandle;
157
157
158
- static std::thread g_load_block;
159
-
160
158
void Interrupt (NodeContext& node)
161
159
{
162
160
InterruptHTTPServer ();
@@ -220,7 +218,7 @@ void Shutdown(NodeContext& node)
220
218
// After everything has been shut down, but before things get flushed, stop the
221
219
// CScheduler/checkqueue, scheduler and load block thread.
222
220
if (node.scheduler ) node.scheduler ->stop ();
223
- if (g_load_block. joinable ()) g_load_block .join ();
221
+ if (node. chainman && node. chainman -> m_load_block . joinable ()) node. chainman -> m_load_block .join ();
224
222
StopScriptCheckWorkerThreads ();
225
223
226
224
// After the threads that potentially access these pointers have been stopped,
@@ -1880,7 +1878,7 @@ bool AppInitMain(const std::any& context, NodeContext& node, interfaces::BlockAn
1880
1878
vImportFiles.push_back (strFile);
1881
1879
}
1882
1880
1883
- g_load_block = std::thread (&TraceThread<std::function<void ()>>, " loadblk" , [=, &chainman, &args] {
1881
+ chainman. m_load_block = std::thread (&TraceThread<std::function<void ()>>, " loadblk" , [=, &chainman, &args] {
1884
1882
ThreadImport (chainman, vImportFiles, args);
1885
1883
});
1886
1884
0 commit comments