mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-08-23 13:12:22 +02:00
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-
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
Reference in New Issue
Block a user