aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces
diff options
context:
space:
mode:
authorRussell Yanofsky <russ@yanofsky.org>2020-04-17 11:28:45 -0400
committerRussell Yanofsky <russ@yanofsky.org>2020-05-13 16:20:13 -0400
commit6fca33b2edc09ed62dab2323c780b31585de1750 (patch)
tree32b5eb4a502b676b3d71bbb168095b93871311b6 /src/interfaces
parent691c817b340d10e806dc3b1834d2a8fcc5e681fd (diff)
downloadbitcoin-6fca33b2edc09ed62dab2323c780b31585de1750.tar.xz
refactor: Pass NodeContext to RPC and REST methods through util::Ref
This commit does not change behavior
Diffstat (limited to 'src/interfaces')
-rw-r--r--src/interfaces/node.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/interfaces/node.cpp b/src/interfaces/node.cpp
index 9e603a12cd..cc0f7db5c1 100644
--- a/src/interfaces/node.cpp
+++ b/src/interfaces/node.cpp
@@ -27,6 +27,7 @@
#include <sync.h>
#include <txmempool.h>
#include <ui_interface.h>
+#include <util/ref.h>
#include <util/system.h>
#include <util/translation.h>
#include <validation.h>
@@ -80,7 +81,7 @@ public:
bool appInitMain() override
{
m_context.chain = MakeChain(m_context);
- return AppInitMain(m_context);
+ return AppInitMain(m_context_ref, m_context);
}
void appShutdown() override
{
@@ -225,7 +226,7 @@ public:
CFeeRate getDustRelayFee() override { return ::dustRelayFee; }
UniValue executeRpc(const std::string& command, const UniValue& params, const std::string& uri) override
{
- JSONRPCRequest req;
+ JSONRPCRequest req(m_context_ref);
req.params = params;
req.strMethod = command;
req.URI = uri;
@@ -323,6 +324,7 @@ public:
}
NodeContext* context() override { return &m_context; }
NodeContext m_context;
+ util::Ref m_context_ref{m_context};
};
} // namespace