Changeset View
Changeset View
Standalone View
Standalone View
src/chain.cpp
Show All 17 Lines | void CChain::SetTip(CBlockIndex *pindex) { | ||||
while (pindex && vChain[pindex->nHeight] != pindex) { | while (pindex && vChain[pindex->nHeight] != pindex) { | ||||
vChain[pindex->nHeight] = pindex; | vChain[pindex->nHeight] = pindex; | ||||
pindex = pindex->pprev; | pindex = pindex->pprev; | ||||
} | } | ||||
} | } | ||||
CBlockLocator CChain::GetLocator(const CBlockIndex *pindex) const { | CBlockLocator CChain::GetLocator(const CBlockIndex *pindex) const { | ||||
int nStep = 1; | int nStep = 1; | ||||
std::vector<uint256> vHave; | std::vector<BlockHash> vHave; | ||||
vHave.reserve(32); | vHave.reserve(32); | ||||
if (!pindex) { | if (!pindex) { | ||||
pindex = Tip(); | pindex = Tip(); | ||||
} | } | ||||
while (pindex) { | while (pindex) { | ||||
vHave.push_back(pindex->GetBlockHash()); | vHave.push_back(pindex->GetBlockHash()); | ||||
// Stop when we have added the genesis block. | // Stop when we have added the genesis block. | ||||
▲ Show 20 Lines • Show All 160 Lines • Show Last 20 Lines |