| 172 | } |
| 173 | |
| 174 | ChainTestingSetup::ChainTestingSetup(const std::string& chainName, const std::string& fedpegscript, const std::vector<const char*>& extra_args) |
| 175 | : BasicTestingSetup(chainName, fedpegscript, extra_args) |
| 176 | { |
| 177 | // We have to run a scheduler thread to prevent ActivateBestChain |
| 178 | // from blocking due to queue overrun. |
| 179 | m_node.scheduler = std::make_unique<CScheduler>(); |
| 180 | m_node.scheduler->m_service_thread = std::thread(util::TraceThread, "scheduler", [&] { m_node.scheduler->serviceQueue(); }); |
| 181 | GetMainSignals().RegisterBackgroundSignalScheduler(*m_node.scheduler); |
| 182 | |
| 183 | m_node.fee_estimator = std::make_unique<CBlockPolicyEstimator>(); |
| 184 | m_node.mempool = std::make_unique<CTxMemPool>(m_node.fee_estimator.get(), 1); |
| 185 | |
| 186 | m_cache_sizes = CalculateCacheSizes(m_args); |
| 187 | |
| 188 | m_node.chainman = std::make_unique<ChainstateManager>(); |
| 189 | m_node.chainman->m_blockman.m_block_tree_db = std::make_unique<CBlockTreeDB>(m_cache_sizes.block_tree_db, true); |
| 190 | |
| 191 | // Start script-checking threads. Set g_parallel_script_checks to true so they are used. |
| 192 | constexpr int script_check_threads = 2; |
| 193 | StartScriptCheckWorkerThreads(script_check_threads); |
| 194 | g_parallel_script_checks = true; |
| 195 | } |
| 196 | |
| 197 | ChainTestingSetup::~ChainTestingSetup() |
| 198 | { |
nothing calls this directly
no test coverage detected