aboutsummaryrefslogtreecommitdiff
path: root/src/node
diff options
context:
space:
mode:
authorRussell Yanofsky <russ@yanofsky.org>2021-04-02 13:35:01 -0400
committerRussell Yanofsky <russ@yanofsky.org>2021-04-07 04:53:26 -0400
commit9044522ef76f880760165d98fab024802ccfc062 (patch)
tree63f8b5c4d33440fda5e50c34ca22c6f80f81e269 /src/node
parentaa69471ecd553dbcd7dd6d1b2e59dfb69d6a0cf3 (diff)
downloadbitcoin-9044522ef76f880760165d98fab024802ccfc062.tar.xz
Drop JSONRPCRequest constructors after #21366
This just makes an additional simplification after #21366 replaced util::Ref with std::any. It was originally suggested https://github.com/bitcoin/bitcoin/pull/21366#issuecomment-792044351 but delayed for a followup. It would have prevented usage bug https://github.com/bitcoin/bitcoin/pull/21572.
Diffstat (limited to 'src/node')
-rw-r--r--src/node/interfaces.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/node/interfaces.cpp b/src/node/interfaces.cpp
index 7ad02f81dc..e10e89b8cf 100644
--- a/src/node/interfaces.cpp
+++ b/src/node/interfaces.cpp
@@ -80,7 +80,7 @@ public:
}
bool appInitMain(interfaces::BlockAndHeaderTipInfo* tip_info) override
{
- return AppInitMain(m_context_ref, *m_context, tip_info);
+ return AppInitMain(*m_context, tip_info);
}
void appShutdown() override
{
@@ -244,7 +244,8 @@ public:
CFeeRate getDustRelayFee() override { return ::dustRelayFee; }
UniValue executeRpc(const std::string& command, const UniValue& params, const std::string& uri) override
{
- JSONRPCRequest req(m_context_ref);
+ JSONRPCRequest req;
+ req.context = m_context;
req.params = params;
req.strMethod = command;
req.URI = uri;
@@ -314,14 +315,8 @@ public:
void setContext(NodeContext* context) override
{
m_context = context;
- if (context) {
- m_context_ref = context;
- } else {
- m_context_ref.reset();
- }
}
NodeContext* m_context{nullptr};
- std::any m_context_ref;
};
bool FillBlock(const CBlockIndex* index, const FoundBlock& block, UniqueLock<RecursiveMutex>& lock, const CChain& active)