Initialize g_connman before initializing the LLMQ system

Background threads of the LLMQ system use g_connman, so it should be
initialized before.
This commit is contained in:
Alexander Block 2019-01-21 15:22:38 +01:00
parent b8d069bcdd
commit c905f1fe10

View File

@ -76,6 +76,8 @@ TestingSetup::TestingSetup(const std::string& chainName) : BasicTestingSetup(cha
boost::filesystem::create_directories(pathTemp);
ForceSetArg("-datadir", pathTemp.string());
mempool.setSanityCheck(1.0);
g_connman = std::unique_ptr<CConnman>(new CConnman(0x1337, 0x1337)); // Deterministic randomness for tests.
connman = g_connman.get();
pblocktree = new CBlockTreeDB(1 << 20, true);
pcoinsdbview = new CCoinsViewDB(1 << 23, true);
llmq::InitLLMQSystem(*evoDb, nullptr, true);
@ -89,8 +91,6 @@ TestingSetup::TestingSetup(const std::string& chainName) : BasicTestingSetup(cha
nScriptCheckThreads = 3;
for (int i=0; i < nScriptCheckThreads-1; i++)
threadGroup.create_thread(&ThreadScriptCheck);
g_connman = std::unique_ptr<CConnman>(new CConnman(0x1337, 0x1337)); // Deterministic randomness for tests.
connman = g_connman.get();
RegisterNodeSignals(GetNodeSignals());
}