Changeset View
Changeset View
Standalone View
Standalone View
src/test/test_bitcoin.cpp
Show First 20 Lines • Show All 91 Lines • ▼ Show 20 Lines | TestingSetup::TestingSetup(const std::string &chainName) | ||||
fs::create_directories(pathTemp); | fs::create_directories(pathTemp); | ||||
gArgs.ForceSetArg("-datadir", pathTemp.string()); | gArgs.ForceSetArg("-datadir", pathTemp.string()); | ||||
// Note that because we don't bother running a scheduler thread here, | // Note that because we don't bother running a scheduler thread here, | ||||
// callbacks via CValidationInterface are unreliable, but that's OK, | // callbacks via CValidationInterface are unreliable, but that's OK, | ||||
// our unit tests aren't testing multiple parts of the code at once. | // our unit tests aren't testing multiple parts of the code at once. | ||||
GetMainSignals().RegisterBackgroundSignalScheduler(scheduler); | GetMainSignals().RegisterBackgroundSignalScheduler(scheduler); | ||||
mempool.setSanityCheck(1.0); | g_mempool.setSanityCheck(1.0); | ||||
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("InitBlockIndex failed."); | throw std::runtime_error("InitBlockIndex failed."); | ||||
} | } | ||||
{ | { | ||||
CValidationState state; | CValidationState state; | ||||
▲ Show 20 Lines • Show All 169 Lines • Show Last 20 Lines |