aboutsummaryrefslogtreecommitdiff
path: root/src/db.cpp
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2011-11-17 14:21:32 -0500
committerGavin Andresen <gavinandresen@gmail.com>2011-11-17 14:21:32 -0500
commit1c15f88653b0f60fe5e021192cbb81c4f193159c (patch)
treed8c2866922bf157e83d861bb2f26976a1169ba38 /src/db.cpp
parent37971fcc76b867681b1df5ee962f3d2a7f12a86e (diff)
Only remove database log files on shutdown after wallet encryption/rewritev0.5.0rc6
Diffstat (limited to 'src/db.cpp')
-rw-r--r--src/db.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/db.cpp b/src/db.cpp
index efd2a375ef..e0f4a01756 100644
--- a/src/db.cpp
+++ b/src/db.cpp
@@ -28,7 +28,12 @@ DbEnv dbenv(0);
static map<string, int> mapFileUseCount;
static map<string, Db*> mapDb;
-static void EnvShutdown(bool fRemoveLogFiles)
+static bool fRemoveLogFiles = false;
+void RemoveLogFilesOnShutdown(bool fIn)
+{
+ fRemoveLogFiles = fIn;
+}
+static void EnvShutdown()
{
if (!fDbEnvInit)
return;
@@ -71,7 +76,7 @@ public:
}
~CDBInit()
{
- EnvShutdown(false);
+ EnvShutdown();
}
}
instance_of_cdbinit;
@@ -289,7 +294,7 @@ bool CDB::Rewrite(const string& strFile, const char* pszSkip)
}
-void DBFlush(bool fShutdown, bool fRemoveLogFiles)
+void DBFlush(bool fShutdown)
{
// Flush log data to the actual data file
// on all files that are not in use
@@ -322,7 +327,7 @@ void DBFlush(bool fShutdown, bool fRemoveLogFiles)
if (mapFileUseCount.empty())
{
dbenv.log_archive(&listp, DB_ARCH_REMOVE);
- EnvShutdown(fRemoveLogFiles);
+ EnvShutdown();
}
}
}