Changeset View
Changeset View
Standalone View
Standalone View
src/net_processing.cpp
Show First 20 Lines • Show All 1,068 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
void PeerLogicValidation::UpdatedBlockTip(const CBlockIndex *pindexNew, | void PeerLogicValidation::UpdatedBlockTip(const CBlockIndex *pindexNew, | ||||
const CBlockIndex *pindexFork, | const CBlockIndex *pindexFork, | ||||
bool fInitialDownload) { | bool fInitialDownload) { | ||||
const int nNewHeight = pindexNew->nHeight; | const int nNewHeight = pindexNew->nHeight; | ||||
connman->SetBestHeight(nNewHeight); | connman->SetBestHeight(nNewHeight); | ||||
g_initial_block_download_completed = !fInitialDownload; | SetServiceFlagsIBDCache(!fInitialDownload); | ||||
if (!fInitialDownload) { | if (!fInitialDownload) { | ||||
// Find the hashes of all blocks that weren't previously in the best | // Find the hashes of all blocks that weren't previously in the best | ||||
// chain. | // chain. | ||||
std::vector<uint256> vHashes; | std::vector<uint256> vHashes; | ||||
const CBlockIndex *pindexToAnnounce = pindexNew; | const CBlockIndex *pindexToAnnounce = pindexNew; | ||||
while (pindexToAnnounce != pindexFork) { | while (pindexToAnnounce != pindexFork) { | ||||
vHashes.push_back(pindexToAnnounce->GetBlockHash()); | vHashes.push_back(pindexToAnnounce->GetBlockHash()); | ||||
pindexToAnnounce = pindexToAnnounce->pprev; | pindexToAnnounce = pindexToAnnounce->pprev; | ||||
▲ Show 20 Lines • Show All 3,241 Lines • Show Last 20 Lines |