-loadblock to load from an external blk000?.dat file

This commit is contained in:
Pieter Wuille
2012-02-20 20:50:26 +01:00
parent 7dbe393629
commit 1d740055da
4 changed files with 72 additions and 3 deletions

View File

@@ -608,7 +608,7 @@ bool CTxDB::LoadBlockIndex()
map<pair<unsigned int, unsigned int>, CBlockIndex*> mapBlockPos;
for (CBlockIndex* pindex = pindexBest; pindex && pindex->pprev; pindex = pindex->pprev)
{
if (pindex->nHeight < nBestHeight-nCheckDepth)
if (fRequestShutdown || pindex->nHeight < nBestHeight-nCheckDepth)
break;
CBlock block;
if (!block.ReadFromDisk(pindex))
@@ -710,7 +710,7 @@ bool CTxDB::LoadBlockIndex()
}
}
}
if (pindexFork)
if (pindexFork && !fRequestShutdown)
{
// Reorg back to the fork
printf("LoadBlockIndex() : *** moving best chain pointer back to block %d\n", pindexFork->nHeight);