Changeset View
Changeset View
Standalone View
Standalone View
src/test/util/setup_common.cpp
Show First 20 Lines • Show All 118 Lines • ▼ Show 20 Lines | TestingSetup::TestingSetup(const std::string &chainName) | ||||
} | } | ||||
{ | { | ||||
BlockValidationState state; | BlockValidationState state; | ||||
if (!ActivateBestChain(config, state)) { | if (!ActivateBestChain(config, state)) { | ||||
throw std::runtime_error(strprintf("ActivateBestChain failed. (%s)", | throw std::runtime_error(strprintf("ActivateBestChain failed. (%s)", | ||||
FormatStateMessage(state))); | FormatStateMessage(state))); | ||||
} | } | ||||
} | } | ||||
nScriptCheckThreads = 3; | constexpr int script_check_threads = 2; | ||||
for (int i = 0; i < nScriptCheckThreads - 1; i++) { | for (int i = 0; i < script_check_threads; ++i) { | ||||
threadGroup.create_thread([i]() { return ThreadScriptCheck(i); }); | threadGroup.create_thread([i]() { return ThreadScriptCheck(i); }); | ||||
} | } | ||||
m_node.mempool = &::g_mempool; | m_node.mempool = &::g_mempool; | ||||
m_node.mempool->setSanityCheck(1.0); | m_node.mempool->setSanityCheck(1.0); | ||||
m_node.banman = | m_node.banman = | ||||
std::make_unique<BanMan>(GetDataDir() / "banlist.dat", chainparams, | std::make_unique<BanMan>(GetDataDir() / "banlist.dat", chainparams, | ||||
nullptr, DEFAULT_MISBEHAVING_BANTIME); | nullptr, DEFAULT_MISBEHAVING_BANTIME); | ||||
▲ Show 20 Lines • Show All 197 Lines • Show Last 20 Lines |