diff options
author | MarcoFalke <falke.marco@gmail.com> | 2018-12-13 14:33:28 -0500 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2018-12-13 14:32:44 -0500 |
commit | faead93c6c7e1d27bd2a1b2a9b496fda838c2996 (patch) | |
tree | c98d48a195cd410f774ebe3ec55c9c910b876911 /src/test/test_bitcoin.cpp | |
parent | 9a4334443085970a42792db3528695585fe7053b (diff) | |
download | bitcoin-faead93c6c7e1d27bd2a1b2a9b496fda838c2996.tar.xz |
test: Make g_insecure_rand_ctx thread_local
Diffstat (limited to 'src/test/test_bitcoin.cpp')
-rw-r--r-- | src/test/test_bitcoin.cpp | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/src/test/test_bitcoin.cpp b/src/test/test_bitcoin.cpp index 9b4076d956..bb8db9fa8d 100644 --- a/src/test/test_bitcoin.cpp +++ b/src/test/test_bitcoin.cpp @@ -11,6 +11,7 @@ #include <crypto/sha256.h> #include <miner.h> #include <net_processing.h> +#include <noui.h> #include <pow.h> #include <rpc/register.h> #include <rpc/server.h> @@ -36,10 +37,7 @@ void CConnmanTest::ClearNodes() g_connman->vNodes.clear(); } -FastRandomContext insecure_rand_ctx; - -extern bool fPrintToConsole; -extern void noui_connect(); +thread_local FastRandomContext g_insecure_rand_ctx; std::ostream& operator<<(std::ostream& os, const uint256& num) { @@ -117,16 +115,16 @@ TestingSetup::TestingSetup(const std::string& chainName) : BasicTestingSetup(cha TestingSetup::~TestingSetup() { - threadGroup.interrupt_all(); - threadGroup.join_all(); - GetMainSignals().FlushBackgroundCallbacks(); - GetMainSignals().UnregisterBackgroundSignalScheduler(); - g_connman.reset(); - peerLogic.reset(); - UnloadBlockIndex(); - pcoinsTip.reset(); - pcoinsdbview.reset(); - pblocktree.reset(); + threadGroup.interrupt_all(); + threadGroup.join_all(); + GetMainSignals().FlushBackgroundCallbacks(); + GetMainSignals().UnregisterBackgroundSignalScheduler(); + g_connman.reset(); + peerLogic.reset(); + UnloadBlockIndex(); + pcoinsTip.reset(); + pcoinsdbview.reset(); + pblocktree.reset(); } TestChain100Setup::TestChain100Setup() : TestingSetup(CBaseChainParams::REGTEST) |