From 44bc988e7becb492a78ed92ea1052f4789012534 Mon Sep 17 00:00:00 2001 From: Cozz Lovan Date: Sun, 31 Aug 2014 05:55:27 +0200 Subject: [Wallet] Do not flush the wallet in AddToWalletIfInvolvingMe(..) --- src/db.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/db.cpp') diff --git a/src/db.cpp b/src/db.cpp index 12650e459f..a9fd8e9517 100644 --- a/src/db.cpp +++ b/src/db.cpp @@ -218,10 +218,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; @@ -298,7 +299,8 @@ void CDB::Close() activeTxn = NULL; pdb = NULL; - Flush(); + if (fFlushOnClose) + Flush(); { LOCK(bitdb.cs_db); -- cgit v1.2.3