Changeset View
Changeset View
Standalone View
Standalone View
src/test/test_bitcoin.cpp
Show First 20 Lines • Show All 95 Lines • ▼ Show 20 Lines | TestingSetup::TestingSetup(const std::string &chainName) | ||||
std::string rpcWarmupStatus; | std::string rpcWarmupStatus; | ||||
if (RPCIsInWarmup(&rpcWarmupStatus)) { | if (RPCIsInWarmup(&rpcWarmupStatus)) { | ||||
SetRPCWarmupFinished(); | SetRPCWarmupFinished(); | ||||
} | } | ||||
ClearDatadirCache(); | ClearDatadirCache(); | ||||
pathTemp = fs::temp_directory_path() / | pathTemp = fs::temp_directory_path() / | ||||
strprintf("test_bitcoin_%lu_%i", (unsigned long)GetTime(), | strprintf("test_bitcoin_%lu_%i", (unsigned long)GetTime(), | ||||
(int)(InsecureRandRange(100000))); | (int)(InsecureRandRange(1 << 30))); | ||||
fs::create_directories(pathTemp); | fs::create_directories(pathTemp); | ||||
gArgs.ForceSetArg("-datadir", pathTemp.string()); | gArgs.ForceSetArg("-datadir", pathTemp.string()); | ||||
// We have to run a scheduler thread to prevent ActivateBestChain | // We have to run a scheduler thread to prevent ActivateBestChain | ||||
// from blocking due to queue overrun. | // from blocking due to queue overrun. | ||||
threadGroup.create_thread( | threadGroup.create_thread( | ||||
boost::bind(&CScheduler::serviceQueue, &scheduler)); | boost::bind(&CScheduler::serviceQueue, &scheduler)); | ||||
GetMainSignals().RegisterBackgroundSignalScheduler(scheduler); | GetMainSignals().RegisterBackgroundSignalScheduler(scheduler); | ||||
▲ Show 20 Lines • Show All 180 Lines • Show Last 20 Lines |