| 30 | boost::thread_group threadGroup; |
| 31 | |
| 32 | TestingSetup() { |
| 33 | SetupEnvironment(); |
| 34 | fPrintToDebugLog = false; // don't want to write to debug.log file |
| 35 | fCheckBlockIndex = true; |
| 36 | SelectParams(CBaseChainParams::UNITTEST); |
| 37 | noui_connect(); |
| 38 | #ifdef ENABLE_WALLET |
| 39 | bitdb.MakeMock(); |
| 40 | #endif |
| 41 | pathTemp = GetTempPath() / strprintf("test_lux_%lu_%i", (unsigned long)GetTime(), (int)(GetRand(100000))); |
| 42 | boost::filesystem::create_directories(pathTemp); |
| 43 | mapArgs["-datadir"] = pathTemp.string(); |
| 44 | pblocktree = new CBlockTreeDB(1 << 20, true); |
| 45 | pcoinsdbview = new CCoinsViewDB(1 << 23, true); |
| 46 | pcoinsTip = new CCoinsViewCache(pcoinsdbview); |
| 47 | InitBlockIndex(Params()); |
| 48 | #ifdef ENABLE_WALLET |
| 49 | bool fFirstRun; |
| 50 | pwalletMain = new CWallet("wallet.dat"); |
| 51 | pwalletMain->LoadWallet(fFirstRun); |
| 52 | RegisterValidationInterface(pwalletMain); |
| 53 | #endif |
| 54 | nScriptCheckThreads = 3; |
| 55 | for (int i=0; i < nScriptCheckThreads-1; i++) |
| 56 | threadGroup.create_thread(&ThreadScriptCheck); |
| 57 | RegisterNodeSignals(GetNodeSignals()); |
| 58 | } |
| 59 | ~TestingSetup() |
| 60 | { |
| 61 | threadGroup.interrupt_all(); |
nothing calls this directly
no test coverage detected