diff options
| author | Suhas Daftuar <[email protected]> | 2014-09-08 13:29:14 -0400 |
|---|---|---|
| committer | Suhas Daftuar <[email protected]> | 2014-09-10 13:51:53 -0400 |
| commit | ec7eb0fa80ce50f0c45c7f764bf4958224721ca0 (patch) | |
| tree | ce421586d0340a7f10fae45f9f844b0f38301148 /src/init.cpp | |
| parent | Merge pull request #4865 (diff) | |
| download | discoin-ec7eb0fa80ce50f0c45c7f764bf4958224721ca0.tar.xz discoin-ec7eb0fa80ce50f0c45c7f764bf4958224721ca0.zip | |
When reindexing check for file before trying to open (refactored)
Diffstat (limited to 'src/init.cpp')
| -rw-r--r-- | src/init.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/init.cpp b/src/init.cpp index 31f64878f..4b95f2936 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -401,9 +401,11 @@ void ThreadImport(std::vector<boost::filesystem::path> vImportFiles) int nFile = 0; while (true) { CDiskBlockPos pos(nFile, 0); + if (!boost::filesystem::exists(GetBlockPosFilename(pos, "blk"))) + break; // No block files left to reindex FILE *file = OpenBlockFile(pos, true); if (!file) - break; + break; // This error is logged in OpenBlockFile LogPrintf("Reindexing block file blk%05u.dat...\n", (unsigned int)nFile); LoadExternalBlockFile(file, &pos); nFile++; |