|
|
@ -1339,23 +1339,6 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) |
|
|
|
// ********************************************************* Step 7: load block chain
|
|
|
|
|
|
|
|
fReindex = GetBoolArg("-reindex", false); |
|
|
|
bool checkval,fAddressIndex,fSpentIndex; |
|
|
|
fAddressIndex = GetBoolArg("-addressindex", DEFAULT_ADDRESSINDEX); |
|
|
|
pblocktree->ReadFlag("addressindex", checkval); |
|
|
|
if ( checkval != fAddressIndex ) |
|
|
|
{ |
|
|
|
pblocktree->WriteFlag("addressindex", fAddressIndex); |
|
|
|
fprintf(stderr,"set addressindex, will reindex. sorry will take a while.\n"); |
|
|
|
fReindex = true; |
|
|
|
} |
|
|
|
fSpentIndex = GetBoolArg("-spentindex", DEFAULT_SPENTINDEX); |
|
|
|
pblocktree->ReadFlag("spentindex", checkval); |
|
|
|
if ( checkval != fSpentIndex ) |
|
|
|
{ |
|
|
|
pblocktree->WriteFlag("spentindex", fSpentIndex); |
|
|
|
fprintf(stderr,"set spentindex, will reindex. sorry will take a while.\n"); |
|
|
|
fReindex = true; |
|
|
|
} |
|
|
|
|
|
|
|
// Upgrading to 0.8; hard-link the old blknnnn.dat files into /blocks/
|
|
|
|
boost::filesystem::path blocksDir = GetDataDir() / "blocks"; |
|
|
@ -1416,6 +1399,28 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) |
|
|
|
LogPrintf("* Using %.1fMiB for chain state database\n", nCoinDBCache * (1.0 / 1024 / 1024)); |
|
|
|
LogPrintf("* Using %.1fMiB for in-memory UTXO set\n", nCoinCacheUsage * (1.0 / 1024 / 1024)); |
|
|
|
|
|
|
|
if ( fReindex == 0 ) |
|
|
|
{ |
|
|
|
bool checkval,fAddressIndex,fSpentIndex; |
|
|
|
pblocktree = new CBlockTreeDB(nBlockTreeDBCache, false, fReindex, dbCompression, dbMaxOpenFiles); |
|
|
|
fAddressIndex = GetBoolArg("-addressindex", DEFAULT_ADDRESSINDEX); |
|
|
|
pblocktree->ReadFlag("addressindex", checkval); |
|
|
|
if ( checkval != fAddressIndex ) |
|
|
|
{ |
|
|
|
pblocktree->WriteFlag("addressindex", fAddressIndex); |
|
|
|
fprintf(stderr,"set addressindex, will reindex. sorry will take a while.\n"); |
|
|
|
fReindex = true; |
|
|
|
} |
|
|
|
fSpentIndex = GetBoolArg("-spentindex", DEFAULT_SPENTINDEX); |
|
|
|
pblocktree->ReadFlag("spentindex", checkval); |
|
|
|
if ( checkval != fSpentIndex ) |
|
|
|
{ |
|
|
|
pblocktree->WriteFlag("spentindex", fSpentIndex); |
|
|
|
fprintf(stderr,"set spentindex, will reindex. sorry will take a while.\n"); |
|
|
|
fReindex = true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
bool fLoaded = false; |
|
|
|
while (!fLoaded) { |
|
|
|
bool fReset = fReindex; |
|
|
|