File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -2941,6 +2941,24 @@ bool static LoadBlockIndexDB()
2941
2941
if (pblocktree->ReadBlockFileInfo (nLastBlockFile, infoLastBlockFile))
2942
2942
LogPrintf (" LoadBlockIndexDB(): last block file info: %s\n " , infoLastBlockFile.ToString ());
2943
2943
2944
+ // Check presence of blk files
2945
+ LogPrintf (" Checking all blk files are present...\n " );
2946
+ set<int > setBlkDataFiles;
2947
+ BOOST_FOREACH (const PAIRTYPE (uint256, CBlockIndex*)& item, mapBlockIndex)
2948
+ {
2949
+ CBlockIndex* pindex = item.second ;
2950
+ if (pindex->nStatus & BLOCK_HAVE_DATA) {
2951
+ setBlkDataFiles.insert (pindex->nFile );
2952
+ }
2953
+ }
2954
+ for (std::set<int >::iterator it = setBlkDataFiles.begin (); it != setBlkDataFiles.end (); it++)
2955
+ {
2956
+ CDiskBlockPos pos (*it, 0 );
2957
+ if (!CAutoFile (OpenBlockFile (pos, true ), SER_DISK, CLIENT_VERSION)) {
2958
+ return false ;
2959
+ }
2960
+ }
2961
+
2944
2962
// Check whether we need to continue reindexing
2945
2963
bool fReindexing = false ;
2946
2964
pblocktree->ReadReindexing (fReindexing );
You can’t perform that action at this time.
0 commit comments