Skip to content

Commit

Permalink
Merge branch 'khalahan/master' into 'namecoin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
khalahan committed Oct 31, 2013
2 parents 7bdfe14 + 89a09d7 commit c4e0e82
Show file tree
Hide file tree
Showing 5 changed files with 412 additions and 112 deletions.
2 changes: 1 addition & 1 deletion src/db.cpp
Expand Up @@ -150,7 +150,7 @@ void CDB::Close()
--mapFileUseCount[strFile];
}

void static CloseDb(const string& strFile)
static void CloseDb(const string& strFile)
{
CRITICAL_BLOCK(cs_db)
{
Expand Down
17 changes: 12 additions & 5 deletions src/init.cpp
Expand Up @@ -548,13 +548,20 @@ bool AppInit2(int argc, char* argv[])

RandAddSeedPerfmon();

filesystem::path nameindexfile = filesystem::path(GetDataDir()) / "nameindexfull.dat";
if (!filesystem::exists(nameindexfile))
{
//PrintConsole("Scanning blockchain for names to create fast index...");
filesystem::path nameindexfile_old = filesystem::path(GetDataDir()) / "nameindexfull.dat";
filesystem::path nameindexfile = filesystem::path(GetDataDir()) / "nameindex.dat";

if (filesystem::exists(nameindexfile_old))
{
// If old file exists - delete it and recan
filesystem::remove(nameindexfile_old);
// Also delete new file if it exists together with the old one, as it could be the one from a much older version
if (filesystem::exists(nameindexfile))
filesystem::remove(nameindexfile);
rescanfornames();
//PrintConsole("\n");
}
else if (!filesystem::exists(nameindexfile))
rescanfornames();

if (!CreateThread(StartNode, NULL))
wxMessageBox("Error: CreateThread(StartNode) failed", "Bitcoin");
Expand Down

0 comments on commit c4e0e82

Please sign in to comment.