| 44 | } |
| 45 | |
| 46 | TestingSetup::TestingSetup() |
| 47 | { |
| 48 | #ifdef ENABLE_WALLET |
| 49 | bitdb.MakeMock(); |
| 50 | #endif |
| 51 | ClearDatadirCache(); |
| 52 | pathTemp = GetTempPath() / strprintf("test_bitcoin_%lu_%i", (unsigned long)GetTime(), (int)(GetRand(100000))); |
| 53 | boost::filesystem::create_directories(pathTemp); |
| 54 | mapArgs["-datadir"] = pathTemp.string(); |
| 55 | mempool.setSanityCheck(1.0); |
| 56 | bool isObfuscated; |
| 57 | pblocktree = new CBlockTreeDB(1 << 20, isObfuscated, true); |
| 58 | pcoinsdbview = new CCoinsViewDB(1 << 23, isObfuscated, true); |
| 59 | pcoinsTip = new CCoinsViewCache(pcoinsdbview); |
| 60 | InitBlockIndex(); |
| 61 | #ifdef ENABLE_WALLET |
| 62 | bool fFirstRun; |
| 63 | pwalletMain = new CWallet("wallet.dat"); |
| 64 | pwalletMain->LoadWallet(fFirstRun); |
| 65 | RegisterValidationInterface(pwalletMain); |
| 66 | #endif |
| 67 | mapArgs["-par"] = "3"; |
| 68 | for (int i=0; i < Opt().ScriptCheckThreads()-1; i++) |
| 69 | threadGroup.create_thread(&ThreadScriptCheck); |
| 70 | RegisterNodeSignals(GetNodeSignals()); |
| 71 | } |
| 72 | |
| 73 | TestingSetup::~TestingSetup() |
| 74 | { |
nothing calls this directly
no test coverage detected