Changeset View
Changeset View
Standalone View
Standalone View
src/test/setup_common.cpp
Show First 20 Lines • Show All 117 Lines • ▼ Show 20 Lines | if (!LoadGenesisBlock(chainparams)) { | ||||
CValidationState state; | CValidationState 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; | nScriptCheckThreads = 3; | ||||
for (int i = 0; i < nScriptCheckThreads - 1; i++) { | for (int i = 0; i < nScriptCheckThreads - 1; i++) { | ||||
threadGroup.create_thread(&ThreadScriptCheck); | threadGroup.create_thread([i]() { return ThreadScriptCheck(i); }); | ||||
} | } | ||||
g_banman = | g_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); | ||||
// Deterministic randomness for tests. | // Deterministic randomness for tests. | ||||
g_connman = std::make_unique<CConnman>(config, 0x1337, 0x1337); | g_connman = std::make_unique<CConnman>(config, 0x1337, 0x1337); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 189 Lines • Show Last 20 Lines |