Reimplement CBlockLocator's chain-related logic in CChain.

This removes a few unused CBlockLocator methods, and moves the
construction and fork-finding logic to CChain (which can do these
more efficiently, as it has a height-indexable chain available).
It also makes CBlockLocator independent from the validation code.
This commit is contained in:
Pieter Wuille
2013-10-12 15:18:08 +02:00
committed by Pieter Wuille
parent b2ba55c42b
commit e4daecda0b
5 changed files with 63 additions and 117 deletions

View File

@@ -1169,7 +1169,9 @@ Value listsinceblock(const Array& params, bool fHelp)
uint256 blockId = 0;
blockId.SetHex(params[0].get_str());
pindex = CBlockLocator(blockId).GetBlockIndex();
std::map<uint256, CBlockIndex*>::iterator it = mapBlockIndex.find(blockId);
if (it != mapBlockIndex.end())
pindex = it->second;
}
if (params.size() > 1)