From 6fb65b49f4d393b091479be5a5df5a0a160cf986 Mon Sep 17 00:00:00 2001 From: Carl Dong Date: Tue, 13 Apr 2021 17:04:43 -0400 Subject: scripted-diff: rest/rpc: Use renamed EnsureAny*() -BEGIN VERIFY SCRIPT- sed -i -E 's@Ensure([^(]+)(\((request\.|)context\))@EnsureAny\1\2@g' \ -- src/rest.cpp src/rpc/*.cpp -END VERIFY SCRIPT- --- src/rest.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/rest.cpp') diff --git a/src/rest.cpp b/src/rest.cpp index 36c7da1e30..dd2d649ff4 100644 --- a/src/rest.cpp +++ b/src/rest.cpp @@ -181,7 +181,7 @@ static bool rest_headers(const std::any& context, headers.reserve(count); { LOCK(cs_main); - ChainstateManager& chainman = EnsureChainman(context); + ChainstateManager& chainman = EnsureAnyChainman(context); tip = chainman.ActiveChain().Tip(); const CBlockIndex* pindex = chainman.m_blockman.LookupBlockIndex(hash); while (pindex != nullptr && chainman.ActiveChain().Contains(pindex)) { @@ -251,7 +251,7 @@ static bool rest_block(const std::any& context, CBlockIndex* tip = nullptr; { LOCK(cs_main); - ChainstateManager& chainman = EnsureChainman(context); + ChainstateManager& chainman = EnsureAnyChainman(context); tip = chainman.ActiveChain().Tip(); pblockindex = chainman.m_blockman.LookupBlockIndex(hash); if (!pblockindex) { @@ -538,7 +538,7 @@ static bool rest_getutxos(const std::any& context, HTTPRequest* req, const std:: std::string bitmapStringRepresentation; std::vector hits; bitmap.resize((vOutPoints.size() + 7) / 8); - ChainstateManager& chainman = EnsureChainman(context); + ChainstateManager& chainman = EnsureAnyChainman(context); { auto process_utxos = [&vOutPoints, &outs, &hits](const CCoinsView& view, const CTxMemPool& mempool) { for (const COutPoint& vOutPoint : vOutPoints) { @@ -642,7 +642,7 @@ static bool rest_blockhash_by_height(const std::any& context, HTTPRequest* req, CBlockIndex* pblockindex = nullptr; { LOCK(cs_main); - const CChain& active_chain = EnsureChainman(context).ActiveChain(); + const CChain& active_chain = EnsureAnyChainman(context).ActiveChain(); if (blockheight > active_chain.Height()) { return RESTERR(req, HTTP_NOT_FOUND, "Block height out of range"); } -- cgit v1.2.3