Changeset View
Changeset View
Standalone View
Standalone View
src/test/util/setup_common.cpp
Show First 20 Lines • Show All 112 Lines • ▼ Show 20 Lines | TestingSetup::TestingSetup(const std::string &chainName) | ||||
pblocktree.reset(new CBlockTreeDB(1 << 20, true)); | pblocktree.reset(new CBlockTreeDB(1 << 20, true)); | ||||
pcoinsdbview.reset(new CCoinsViewDB(1 << 23, true)); | pcoinsdbview.reset(new CCoinsViewDB(1 << 23, true)); | ||||
pcoinsTip.reset(new CCoinsViewCache(pcoinsdbview.get())); | pcoinsTip.reset(new CCoinsViewCache(pcoinsdbview.get())); | ||||
if (!LoadGenesisBlock(chainparams)) { | if (!LoadGenesisBlock(chainparams)) { | ||||
throw std::runtime_error("LoadGenesisBlock failed."); | throw std::runtime_error("LoadGenesisBlock failed."); | ||||
} | } | ||||
{ | { | ||||
CValidationState 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; | nScriptCheckThreads = 3; | ||||
for (int i = 0; i < nScriptCheckThreads - 1; i++) { | for (int i = 0; i < nScriptCheckThreads - 1; i++) { | ||||
threadGroup.create_thread([i]() { return ThreadScriptCheck(i); }); | threadGroup.create_thread([i]() { return ThreadScriptCheck(i); }); | ||||
▲ Show 20 Lines • Show All 204 Lines • Show Last 20 Lines |