Skip to content

Commit

Permalink
Cherry-picking PR #597 gp/reindexing_GUI_fix
Browse files Browse the repository at this point in the history
  • Loading branch information
JackPiri authored and a-petrini committed Aug 30, 2023
1 parent b2e840f commit f30ca39
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,10 @@ void ThreadImport(std::vector<boost::filesystem::path> vImportFiles)
break; // No block files left to reindex
FILE *file = OpenBlockFile(pos, true);
assert(file); // This error is logged in OpenBlockFile
uiInterface.InitMessage(tfm::format(_("Reindexing block headers from files...") + "(blk%05i.dat)", pos.nFile));
if (chainActive.Tip() == NULL)
uiInterface.InitMessage(tfm::format(_("Reindexing block headers from files...") + "(blk%05i.dat)", pos.nFile));
else
uiInterface.InitMessageAfterLoading(tfm::format(_("Reindexing block headers from files...") + "(blk%05i.dat)", pos.nFile));
LogPrintf("Reindexing block file blk%05i.dat, headers-only...\n", pos.nFile);
LoadBlocksFromExternalFile(file, &pos, /*loadHeadersOnly*/true);
++pos.nFile;
Expand Down

0 comments on commit f30ca39

Please sign in to comment.