aboutsummaryrefslogtreecommitdiff
path: root/src/init.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2014-09-16 03:15:11 +0200
committerPieter Wuille <pieter.wuille@gmail.com>2014-09-16 03:21:21 +0200
commit765f3984364bfd9647efa5f3e978cf203a7c5183 (patch)
tree2a97acaa13580c855549154f42f2f9e952443b63 /src/init.cpp
parent327dcfece7e13ceaeafbf29785e3076dbf6f1d28 (diff)
parentf7e36370f36ca806076cdcf0cd3ed0c35fd38c42 (diff)
downloadbitcoin-765f3984364bfd9647efa5f3e978cf203a7c5183.tar.xz
Merge pull request #4875
f7e3637 Eliminate extra assignment (Suhas Daftuar) ec7eb0f When reindexing check for file before trying to open (refactored) (Suhas Daftuar)
Diffstat (limited to 'src/init.cpp')
-rw-r--r--src/init.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 6e47536d38..77bbc54dea 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -402,9 +402,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++;