From 76ef6d89b98b57d2ee5c6db993cd1cc375dd3726 Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Sun, 20 Nov 2011 10:39:01 -0500 Subject: Never remove database files on shutdown, it caused unreadable wallets on some testers' machines. --- src/db.cpp | 23 ----------------------- 1 file changed, 23 deletions(-) (limited to 'src/db.cpp') diff --git a/src/db.cpp b/src/db.cpp index 77000ab00e..5cacf19692 100644 --- a/src/db.cpp +++ b/src/db.cpp @@ -28,11 +28,6 @@ DbEnv dbenv(0); static map mapFileUseCount; static map mapDb; -static bool fRemoveLogFiles = false; -void RemoveLogFilesOnShutdown(bool fIn) -{ - fRemoveLogFiles = fIn; -} static void EnvShutdown() { if (!fDbEnvInit) @@ -48,24 +43,6 @@ static void EnvShutdown() printf("EnvShutdown exception: %s (%d)\n", e.what(), e.get_errno()); } DbEnv(0).remove(GetDataDir().c_str(), 0); - - if (fRemoveLogFiles) - { - filesystem::path datadir(GetDataDir()); - filesystem::directory_iterator it(datadir / "database"); - while (it != filesystem::directory_iterator()) - { - const filesystem::path& p = it->path(); -#if BOOST_FILESYSTEM_VERSION >= 3 - std::string f = p.filename().generic_string(); -#else - std::string f = p.filename(); -#endif - if (f.find("log.") == 0) - filesystem::remove(p); - ++it; - } - } } class CDBInit -- cgit v1.2.3