mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02: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:
parent
b2ba55c42b
commit
e4daecda0b
5 changed files with 63 additions and 117 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue