Changeset View
Changeset View
Standalone View
Standalone View
src/test/test_bitcoin.cpp
Show First 20 Lines • Show All 123 Lines • ▼ Show 20 Lines | TestingSetup::TestingSetup(const std::string &chainName) | ||||
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); | ||||
} | } | ||||
// Deterministic randomness for tests. | // Deterministic randomness for tests. | ||||
g_connman = std::unique_ptr<CConnman>(new CConnman(config, 0x1337, 0x1337)); | g_connman = std::unique_ptr<CConnman>(new CConnman(config, 0x1337, 0x1337)); | ||||
connman = g_connman.get(); | connman = g_connman.get(); | ||||
peerLogic.reset(new PeerLogicValidation(connman, scheduler)); | peerLogic.reset( | ||||
new PeerLogicValidation(connman, scheduler, /*enable_bip61=*/true)); | |||||
} | } | ||||
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(); | ||||
▲ Show 20 Lines • Show All 81 Lines • Show Last 20 Lines |