mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
Give CMainSignals a reference to the global scheduler
...so that it can run some signals in the background later
This commit is contained in:
@@ -62,6 +62,12 @@ TestingSetup::TestingSetup(const std::string& chainName) : BasicTestingSetup(cha
|
||||
pathTemp = GetTempPath() / strprintf("test_bitcoin_%lu_%i", (unsigned long)GetTime(), (int)(InsecureRandRange(100000)));
|
||||
fs::create_directories(pathTemp);
|
||||
ForceSetArg("-datadir", pathTemp.string());
|
||||
|
||||
// Note that because we don't bother running a scheduler thread here,
|
||||
// callbacks via CValidationInterface are unreliable, but that's OK,
|
||||
// our unit tests aren't testing multiple parts of the code at once.
|
||||
GetMainSignals().RegisterBackgroundSignalScheduler(scheduler);
|
||||
|
||||
mempool.setSanityCheck(1.0);
|
||||
pblocktree = new CBlockTreeDB(1 << 20, true);
|
||||
pcoinsdbview = new CCoinsViewDB(1 << 23, true);
|
||||
@@ -88,6 +94,7 @@ TestingSetup::~TestingSetup()
|
||||
UnregisterNodeSignals(GetNodeSignals());
|
||||
threadGroup.interrupt_all();
|
||||
threadGroup.join_all();
|
||||
GetMainSignals().UnregisterBackgroundSignalScheduler();
|
||||
UnloadBlockIndex();
|
||||
delete pcoinsTip;
|
||||
delete pcoinsdbview;
|
||||
|
||||
Reference in New Issue
Block a user