From 6fca33b2edc09ed62dab2323c780b31585de1750 Mon Sep 17 00:00:00 2001 From: Russell Yanofsky Date: Fri, 17 Apr 2020 11:28:45 -0400 Subject: refactor: Pass NodeContext to RPC and REST methods through util::Ref This commit does not change behavior --- src/rpc/blockchain.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/rpc/blockchain.h') diff --git a/src/rpc/blockchain.h b/src/rpc/blockchain.h index a02e5fae0e..fec9a0d3c5 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; @@ -52,6 +55,7 @@ void CalculatePercentilesByWeight(CAmount result[NUM_GETBLOCKSTATS_PERCENTILES], //! 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 -- cgit v1.2.3