aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/blockchain.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/rpc/blockchain.h')
-rw-r--r--src/rpc/blockchain.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/rpc/blockchain.h b/src/rpc/blockchain.h
index 54165af707..453d0bc650 100644
--- a/src/rpc/blockchain.h
+++ b/src/rpc/blockchain.h
@@ -18,6 +18,9 @@ class CBlockIndex;
class CTxMemPool;
class UniValue;
struct NodeContext;
+namespace util {
+class Ref;
+} // namespace util
static constexpr int NUM_GETBLOCKSTATS_PERCENTILES = 5;
@@ -47,11 +50,7 @@ UniValue blockheaderToJSON(const CBlockIndex* tip, const CBlockIndex* blockindex
/** Used by getblockstats to get feerates at different percentiles by weight */
void CalculatePercentilesByWeight(CAmount result[NUM_GETBLOCKSTATS_PERCENTILES], std::vector<std::pair<CAmount, int64_t>>& scores, int64_t total_weight);
-//! Pointer to node state that needs to be declared as a global to be accessible
-//! RPC methods. Due to limitations of the RPC framework, there's currently no
-//! direct way to pass in state to RPC methods without globals.
-extern NodeContext* g_rpc_node;
-
-CTxMemPool& EnsureMemPool();
+NodeContext& EnsureNodeContext(const util::Ref& context);
+CTxMemPool& EnsureMemPool(const util::Ref& context);
#endif