Move global scriptcheckqueue into ChainstateManager class

This commit is contained in:
Hennadii Stepanov
2023-07-07 10:33:11 +01:00
parent 4e78834ec1
commit be4ff3060b
7 changed files with 38 additions and 42 deletions

View File

@@ -176,6 +176,7 @@ ChainTestingSetup::ChainTestingSetup(const ChainType chainType, const std::vecto
.adjusted_time_callback = GetAdjustedTime,
.check_block_index = true,
.notifications = *m_node.notifications,
.worker_threads_num = 2,
};
const BlockManager::Options blockman_opts{
.chainparams = chainman_opts.chainparams,
@@ -187,15 +188,12 @@ ChainTestingSetup::ChainTestingSetup(const ChainType chainType, const std::vecto
.path = m_args.GetDataDirNet() / "blocks" / "index",
.cache_bytes = static_cast<size_t>(m_cache_sizes.block_tree_db),
.memory_only = true});
constexpr int script_check_threads = 2;
StartScriptCheckWorkerThreads(script_check_threads);
}
ChainTestingSetup::~ChainTestingSetup()
{
if (m_node.scheduler) m_node.scheduler->stop();
StopScriptCheckWorkerThreads();
m_node.chainman->StopScriptCheckWorkerThreads();
GetMainSignals().FlushBackgroundCallbacks();
GetMainSignals().UnregisterBackgroundSignalScheduler();
m_node.connman.reset();