本文整理汇总了C++中CBlockIndex::IsPlaceHolderBlock方法的典型用法代码示例。如果您正苦于以下问题:C++ CBlockIndex::IsPlaceHolderBlock方法的具体用法?C++ CBlockIndex::IsPlaceHolderBlock怎么用?C++ CBlockIndex::IsPlaceHolderBlock使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBlockIndex
的用法示例。
在下文中一共展示了CBlockIndex::IsPlaceHolderBlock方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadBlockIndex
//.........这里部分代码省略.........
}
delete iterator;
if (fRequestShutdown)
return true;
// Load hashBestChain pointer to end of best chain
if (!ReadHashBestChain(hashBestChain))
{
if (pindexGenesisBlock == NULL)
return true;
return error("CTxDB::LoadBlockIndex() : hashBestChain not loaded");
}
if (!mapBlockIndex.count(hashBestChain))
return error("CTxDB::LoadBlockIndex() : hashBestChain not found in the block index");
pindexBest = mapBlockIndex[hashBestChain];
nBestHeight = pindexBest->nHeight;
// Figure out what our load state is.
if (pindexGenesisBlock)
{
prevLoadState = LoadState_OldBlockIndex;
// If genesis block is marked as verified we have a new 'hybrid' block index otherwise its an old index from before hybrid mode came into existence.
if (pindexGenesisBlock->IsVerified())
{
prevLoadState = LoadState_CheckPoint;
CBlockIndex* pIndex = pindexGenesisBlock->pnext;
while (pIndex)
{
if (pIndex->IsHeaderOnly())
{
prevLoadState = LoadState_SyncAllBlocks;
}
else if (pIndex->IsPlaceHolderBlock())
{
prevLoadState = LoadState_SyncAllHeaders;
break;
}
pIndex = pIndex->pnext;
}
if (prevLoadState == LoadState_CheckPoint && nBestHeight <= Checkpoints::GetNumCheckpoints())
{
//fixme: LIGHTHYBRID Automatically delete and restart instead of error message...
return error("LoadBlockIndex() : Previous block index invalid and needs to be regenerated.");
}
}
}
// Calculate nChainTrust
vector<pair<int, CBlockIndex*> > vSortedByHeight;
vSortedByHeight.reserve(mapBlockIndex.size());
BOOST_FOREACH(const PAIRTYPE(uint256, CBlockIndex*)& item, mapBlockIndex)
{
CBlockIndex* pindex = item.second;
vSortedByHeight.push_back(make_pair(pindex->nHeight, pindex));
}
sort(vSortedByHeight.begin(), vSortedByHeight.end());
BOOST_FOREACH(const PAIRTYPE(int, CBlockIndex*)& item, vSortedByHeight)
{
CBlockIndex* pindex = item.second;
pindex->nChainTrust = (pindex->pprev ? pindex->pprev->nChainTrust : 0) + pindex->GetBlockTrust();
if(currentClientMode == ClientFull || ( currentClientMode == ClientHybrid && ( prevLoadState == LoadState_AcceptingNewBlocks || prevLoadState == LoadState_OldBlockIndex )) )
{
// NovaCoin: calculate stake modifier checksum
pindex->nStakeModifierChecksum = GetStakeModifierChecksum(pindex);