Skip to content

Commit 038854f

Browse files
committed
rest/rpc: Remove now-unused old Ensure functions
The scripted-diff in the previous commit should have removed all calls to functions like: Ensure(?!Any)\(const std::any& (context|ctx)\), so we can remove them now.
1 parent 6fb65b4 commit 038854f

File tree

2 files changed

+0
-20
lines changed

2 files changed

+0
-20
lines changed

src/rpc/blockchain.cpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,6 @@ static Mutex cs_blockchange;
5555
static std::condition_variable cond_blockchange;
5656
static CUpdatedBlock latestblock GUARDED_BY(cs_blockchange);
5757

58-
NodeContext& EnsureNodeContext(const std::any& ctx) {
59-
return EnsureAnyNodeContext(ctx);
60-
}
61-
6258
NodeContext& EnsureAnyNodeContext(const std::any& context)
6359
{
6460
auto node_context = util::AnyPtr<NodeContext>(context);
@@ -68,10 +64,6 @@ NodeContext& EnsureAnyNodeContext(const std::any& context)
6864
return *node_context;
6965
}
7066

71-
CTxMemPool& EnsureMemPool(const std::any& ctx) {
72-
return EnsureAnyMemPool(ctx);
73-
}
74-
7567
CTxMemPool& EnsureMemPool(const NodeContext& node)
7668
{
7769
if (!node.mempool) {
@@ -85,10 +77,6 @@ CTxMemPool& EnsureAnyMemPool(const std::any& context)
8577
return EnsureMemPool(EnsureAnyNodeContext(context));
8678
}
8779

88-
ChainstateManager& EnsureChainman(const std::any& ctx) {
89-
return EnsureAnyChainman(ctx);
90-
}
91-
9280
ChainstateManager& EnsureChainman(const NodeContext& node)
9381
{
9482
if (!node.chainman) {
@@ -103,10 +91,6 @@ ChainstateManager& EnsureAnyChainman(const std::any& context)
10391
return EnsureChainman(EnsureAnyNodeContext(context));
10492
}
10593

106-
CBlockPolicyEstimator& EnsureFeeEstimator(const std::any& ctx) {
107-
return EnsureAnyFeeEstimator(ctx);
108-
}
109-
11094
CBlockPolicyEstimator& EnsureFeeEstimator(const NodeContext& node)
11195
{
11296
if (!node.fee_estimator) {

src/rpc/blockchain.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,12 @@ void CalculatePercentilesByWeight(CAmount result[NUM_GETBLOCKSTATS_PERCENTILES],
5656
void ScriptPubKeyToUniv(const CScript& scriptPubKey, UniValue& out, bool fIncludeHex);
5757
void TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry, bool include_hex = true, int serialize_flags = 0, const CTxUndo* txundo = nullptr);
5858

59-
NodeContext& EnsureNodeContext(const std::any& context);
6059
NodeContext& EnsureAnyNodeContext(const std::any& context);
6160
CTxMemPool& EnsureMemPool(const NodeContext& node);
62-
CTxMemPool& EnsureMemPool(const std::any& context);
6361
CTxMemPool& EnsureAnyMemPool(const std::any& context);
6462
ChainstateManager& EnsureChainman(const NodeContext& node);
65-
ChainstateManager& EnsureChainman(const std::any& context);
6663
ChainstateManager& EnsureAnyChainman(const std::any& context);
6764
CBlockPolicyEstimator& EnsureFeeEstimator(const NodeContext& node);
68-
CBlockPolicyEstimator& EnsureFeeEstimator(const std::any& context);
6965
CBlockPolicyEstimator& EnsureAnyFeeEstimator(const std::any& context);
7066

7167
/**

0 commit comments

Comments
 (0)