aboutsummaryrefslogtreecommitdiff
path: root/src/db.cpp
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2011-11-20 10:39:01 -0500
committerGavin Andresen <gavinandresen@gmail.com>2011-11-20 10:39:01 -0500
commitb2d3b2d65dedf3e00431e7f178a4315eb4baf47a (patch)
tree45ea76c8b6d29ffc6e3feb3832607b3f2fcafc6f /src/db.cpp
parent1c15f88653b0f60fe5e021192cbb81c4f193159c (diff)
Never remove database files on shutdown, it caused unreadable wallets on some testers' machines.
Diffstat (limited to 'src/db.cpp')
-rw-r--r--src/db.cpp23
1 files changed, 0 insertions, 23 deletions
diff --git a/src/db.cpp b/src/db.cpp
index e0f4a01756..05fd67c501 100644
--- a/src/db.cpp
+++ b/src/db.cpp
@@ -28,11 +28,6 @@ DbEnv dbenv(0);
static map<string, int> mapFileUseCount;
static map<string, Db*> 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