Changeset View
Changeset View
Standalone View
Standalone View
src/test/test_bitcoin.cpp
Show First 20 Lines • Show All 110 Lines • ▼ Show 20 Lines | if (!LoadGenesisBlock(chainparams)) { | ||||
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(&ThreadScriptCheck); | ||||
} | } | ||||
g_banman = std::make_unique<BanMan>(chainparams, nullptr); | |||||
// 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); | ||||
} | } | ||||
TestingSetup::~TestingSetup() { | TestingSetup::~TestingSetup() { | ||||
threadGroup.interrupt_all(); | threadGroup.interrupt_all(); | ||||
threadGroup.join_all(); | threadGroup.join_all(); | ||||
GetMainSignals().FlushBackgroundCallbacks(); | GetMainSignals().FlushBackgroundCallbacks(); | ||||
GetMainSignals().UnregisterBackgroundSignalScheduler(); | GetMainSignals().UnregisterBackgroundSignalScheduler(); | ||||
g_connman.reset(); | g_connman.reset(); | ||||
g_banman.reset(); | |||||
UnloadBlockIndex(); | UnloadBlockIndex(); | ||||
pcoinsTip.reset(); | pcoinsTip.reset(); | ||||
pcoinsdbview.reset(); | pcoinsdbview.reset(); | ||||
pblocktree.reset(); | pblocktree.reset(); | ||||
} | } | ||||
TestChain100Setup::TestChain100Setup() | TestChain100Setup::TestChain100Setup() | ||||
: TestingSetup(CBaseChainParams::REGTEST) { | : TestingSetup(CBaseChainParams::REGTEST) { | ||||
▲ Show 20 Lines • Show All 72 Lines • Show Last 20 Lines |