aboutsummaryrefslogtreecommitdiff
path: root/src/db.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2015-01-26 12:18:42 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2015-01-26 12:19:12 +0100
commit8204e19abed6c6ee8dca4a00943abfc52ea68fab (patch)
tree630099e9f695ed98b34cc0f4be992bb581c98a19 /src/db.cpp
parentb01a435c34f0669affece2b3d90f92c347588d69 (diff)
parent44bc988e7becb492a78ed92ea1052f4789012534 (diff)
Merge pull request #4805
44bc988 [Wallet] Do not flush the wallet in AddToWalletIfInvolvingMe(..) (Cozz Lovan)
Diffstat (limited to 'src/db.cpp')
-rw-r--r--src/db.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/db.cpp b/src/db.cpp
index fcc177f1cc..7b51707f60 100644
--- a/src/db.cpp
+++ b/src/db.cpp
@@ -217,10 +217,11 @@ void CDBEnv::CheckpointLSN(const std::string& strFile)
}
-CDB::CDB(const std::string& strFilename, const char* pszMode) : pdb(NULL), activeTxn(NULL)
+CDB::CDB(const std::string& strFilename, const char* pszMode, bool fFlushOnCloseIn) : pdb(NULL), activeTxn(NULL)
{
int ret;
fReadOnly = (!strchr(pszMode, '+') && !strchr(pszMode, 'w'));
+ fFlushOnClose = fFlushOnCloseIn;
if (strFilename.empty())
return;
@@ -297,7 +298,8 @@ void CDB::Close()
activeTxn = NULL;
pdb = NULL;
- Flush();
+ if (fFlushOnClose)
+ Flush();
{
LOCK(bitdb.cs_db);