Add LookupBlockIndex function

This commit is contained in:
João Barbosa
2018-01-12 00:23:09 +00:00
parent 43a32b7395
commit 92fabcd443
14 changed files with 139 additions and 133 deletions

View File

@ -428,6 +428,13 @@ public:
/** Replay blocks that aren't fully applied to the database. */
bool ReplayBlocks(const CChainParams& params, CCoinsView* view);
inline CBlockIndex* LookupBlockIndex(const uint256& hash)
{
AssertLockHeld(cs_main);
BlockMap::const_iterator it = mapBlockIndex.find(hash);
return it == mapBlockIndex.end() ? nullptr : it->second;
}
/** Find the last common block between the parameter chain and a locator. */
CBlockIndex* FindForkInGlobalIndex(const CChain& chain, const CBlockLocator& locator);