aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/db.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/wallet/db.cpp')
-rw-r--r--src/wallet/db.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/wallet/db.cpp b/src/wallet/db.cpp
index cdf785a957..0ea4ea3673 100644
--- a/src/wallet/db.cpp
+++ b/src/wallet/db.cpp
@@ -364,7 +364,10 @@ CDB::CDB(CWalletDBWrapper& dbw, const char* pszMode, bool fFlushOnCloseIn) : pdb
int ret;
fReadOnly = (!strchr(pszMode, '+') && !strchr(pszMode, 'w'));
fFlushOnClose = fFlushOnCloseIn;
- const std::string& strFilename = dbw.strFile;
+ if (dbw.IsDummy()) {
+ return;
+ }
+ const std::string &strFilename = dbw.strFile;
bool fCreate = strchr(pszMode, 'c') != NULL;
unsigned int nFlags = DB_THREAD;
@@ -473,7 +476,7 @@ bool CDBEnv::RemoveDb(const std::string& strFile)
bool CDB::Rewrite(CWalletDBWrapper& dbw, const char* pszSkip)
{
- if (!dbw.env) {
+ if (dbw.IsDummy()) {
return true;
}
const std::string& strFile = dbw.strFile;
@@ -601,6 +604,9 @@ void CDBEnv::Flush(bool fShutdown)
bool CDB::PeriodicFlush(CWalletDBWrapper& dbw)
{
+ if (dbw.IsDummy()) {
+ return true;
+ }
bool ret = false;
const std::string& strFile = dbw.strFile;
TRY_LOCK(bitdb.cs_db,lockDb);
@@ -645,7 +651,7 @@ bool CWalletDBWrapper::Rewrite(const char* pszSkip)
bool CWalletDBWrapper::Backup(const std::string& strDest)
{
- if (!env) {
+ if (IsDummy()) {
return false;
}
while (true)