aboutsummaryrefslogtreecommitdiff
path: root/src/test/setup_common.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/setup_common.cpp')
-rw-r--r--src/test/setup_common.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/test/setup_common.cpp b/src/test/setup_common.cpp
index 4efd3d42c4..89a19e172d 100644
--- a/src/test/setup_common.cpp
+++ b/src/test/setup_common.cpp
@@ -15,6 +15,7 @@
#include <net.h>
#include <noui.h>
#include <pow.h>
+#include <rpc/blockchain.h>
#include <rpc/register.h>
#include <rpc/server.h>
#include <script/sigcache.h>
@@ -76,6 +77,7 @@ TestingSetup::TestingSetup(const std::string& chainName) : BasicTestingSetup(cha
const CChainParams& chainparams = Params();
// Ideally we'd move all the RPC tests to the functional testing framework
// instead of unit tests, but for now we need these here.
+ g_rpc_node = &m_node;
RegisterAllCoreRPCCommands(tableRPC);
// We have to run a scheduler thread to prevent ActivateBestChain
@@ -114,6 +116,7 @@ TestingSetup::~TestingSetup()
threadGroup.join_all();
GetMainSignals().FlushBackgroundCallbacks();
GetMainSignals().UnregisterBackgroundSignalScheduler();
+ g_rpc_node = nullptr;
m_node.connman.reset();
m_node.banman.reset();
UnloadBlockIndex();