mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-04 04:45:10 +02:00
refactoring: remove mapBlockIndex global
in lieu of ::BlockIndex().
This commit is contained in:
@@ -1456,7 +1456,7 @@ static UniValue getchaintips(const JSONRPCRequest& request)
|
||||
/*
|
||||
* Idea: the set of chain tips is ::ChainActive().tip, plus orphan blocks which do not have another orphan building off of them.
|
||||
* Algorithm:
|
||||
* - Make one pass through mapBlockIndex, picking out the orphan blocks, and also storing a set of the orphan block's pprev pointers.
|
||||
* - Make one pass through g_blockman.m_block_index, picking out the orphan blocks, and also storing a set of the orphan block's pprev pointers.
|
||||
* - Iterate through the orphan blocks. If the block isn't pointed to by another orphan, it is a chain tip.
|
||||
* - add ::ChainActive().Tip()
|
||||
*/
|
||||
@@ -1464,7 +1464,7 @@ static UniValue getchaintips(const JSONRPCRequest& request)
|
||||
std::set<const CBlockIndex*> setOrphans;
|
||||
std::set<const CBlockIndex*> setPrevs;
|
||||
|
||||
for (const std::pair<const uint256, CBlockIndex*>& item : mapBlockIndex)
|
||||
for (const std::pair<const uint256, CBlockIndex*>& item : ::BlockIndex())
|
||||
{
|
||||
if (!::ChainActive().Contains(item.second)) {
|
||||
setOrphans.insert(item.second);
|
||||
|
||||
Reference in New Issue
Block a user