mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-16 13:01:19 +02:00
When reindexing check for file before trying to open (refactored)
This commit is contained in:
parent
df623d83da
commit
ec7eb0fa80
3 changed files with 12 additions and 2 deletions
|
|
@ -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++;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue