Changeset View
Changeset View
Standalone View
Standalone View
src/validation.cpp
Show First 20 Lines • Show All 4,846 Lines • ▼ Show 20 Lines | bool CChainState::ReplayBlocks(const Consensus::Params ¶ms, | ||||
// Roll forward from the forking point to the new tip. | // Roll forward from the forking point to the new tip. | ||||
int nForkHeight = pindexFork ? pindexFork->nHeight : 0; | int nForkHeight = pindexFork ? pindexFork->nHeight : 0; | ||||
for (int nHeight = nForkHeight + 1; nHeight <= pindexNew->nHeight; | for (int nHeight = nForkHeight + 1; nHeight <= pindexNew->nHeight; | ||||
++nHeight) { | ++nHeight) { | ||||
const CBlockIndex *pindex = pindexNew->GetAncestor(nHeight); | const CBlockIndex *pindex = pindexNew->GetAncestor(nHeight); | ||||
LogPrintf("Rolling forward %s (%i)\n", | LogPrintf("Rolling forward %s (%i)\n", | ||||
pindex->GetBlockHash().ToString(), nHeight); | pindex->GetBlockHash().ToString(), nHeight); | ||||
uiInterface.ShowProgress(_("Replaying blocks...").translated, | |||||
(int)((nHeight - nForkHeight) * 100.0 / | |||||
(pindexNew->nHeight - nForkHeight)), | |||||
false); | |||||
if (!RollforwardBlock(pindex, cache, params)) { | if (!RollforwardBlock(pindex, cache, params)) { | ||||
return false; | return false; | ||||
} | } | ||||
} | } | ||||
cache.SetBestBlock(pindexNew->GetBlockHash()); | cache.SetBestBlock(pindexNew->GetBlockHash()); | ||||
cache.Flush(); | cache.Flush(); | ||||
uiInterface.ShowProgress("", 100, false); | uiInterface.ShowProgress("", 100, false); | ||||
▲ Show 20 Lines • Show All 810 Lines • Show Last 20 Lines |