aboutsummaryrefslogtreecommitdiff
path: root/src/rest.cpp
diff options
context:
space:
mode:
authorCarl Dong <contact@carldong.me>2020-08-25 17:39:57 -0400
committerCarl Dong <contact@carldong.me>2021-01-28 14:15:26 -0500
commiteae54e6e60d7ed05b29d8345c0bb055397149ce8 (patch)
treeca337597b1656e3a68bb585d70eacd8868bdcd50 /src/rest.cpp
parent15d20f40e1321b24963b40c12958c7d30ad112ec (diff)
scripted-diff: Use BlockManager::LookupBlockIndex
[META] In a previous commit, we moved ::LookupBlockIndex to become a member function of BlockManager. This commit is split out from that one since it can be expressed nicely as a scripted-diff. -BEGIN VERIFY SCRIPT- find_regex='LookupBlockIndex' \ && git grep -l -E "$find_regex" -- src \ | grep -v '^src/validation\.\(cpp\|h\)$' \ | xargs sed -i -E "s@${find_regex}@g_chainman.m_blockman.LookupBlockIndex@g" -END VERIFY SCRIPT-
Diffstat (limited to 'src/rest.cpp')
-rw-r--r--src/rest.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rest.cpp b/src/rest.cpp
index 678ffdb760..f872f6e59d 100644
--- a/src/rest.cpp
+++ b/src/rest.cpp
@@ -179,7 +179,7 @@ static bool rest_headers(const util::Ref& context,
{
LOCK(cs_main);
tip = ::ChainActive().Tip();
- const CBlockIndex* pindex = LookupBlockIndex(hash);
+ const CBlockIndex* pindex = g_chainman.m_blockman.LookupBlockIndex(hash);
while (pindex != nullptr && ::ChainActive().Contains(pindex)) {
headers.push_back(pindex);
if (headers.size() == (unsigned long)count)
@@ -247,7 +247,7 @@ static bool rest_block(HTTPRequest* req,
{
LOCK(cs_main);
tip = ::ChainActive().Tip();
- pblockindex = LookupBlockIndex(hash);
+ pblockindex = g_chainman.m_blockman.LookupBlockIndex(hash);
if (!pblockindex) {
return RESTERR(req, HTTP_NOT_FOUND, hashStr + " not found");
}