mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-13 15:39:05 +01:00
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:
committed by
Pieter Wuille
parent
b2ba55c42b
commit
e4daecda0b
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user