From ec7eb0fa80ce50f0c45c7f764bf4958224721ca0 Mon Sep 17 00:00:00 2001 From: Suhas Daftuar Date: Mon, 8 Sep 2014 13:29:14 -0400 Subject: When reindexing check for file before trying to open (refactored) --- src/init.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/init.cpp') 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 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++; -- cgit v1.2.3