diff options
Diffstat (limited to 'src/db.cpp')
| -rw-r--r-- | src/db.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/db.cpp b/src/db.cpp index 5671993d3..867703fbd 100644 --- a/src/db.cpp +++ b/src/db.cpp @@ -195,10 +195,7 @@ CDB::CDB(const char *pszFile, const char* pszMode) : { delete pdb; pdb = NULL; - { - LOCK(bitdb.cs_db); - --bitdb.mapFileUseCount[strFile]; - } + --bitdb.mapFileUseCount[strFile]; strFile = ""; throw runtime_error(strprintf("CDB() : can't open database file %s, error %d", pszFile, ret)); } @@ -284,7 +281,7 @@ bool CDB::Rewrite(const string& strFile, const char* pszSkip) { // surround usage of db with extra {} CDB db(strFile.c_str(), "r"); Db* pdbCopy = new Db(&bitdb.dbenv, 0); - + int ret = pdbCopy->open(NULL, // Txn pointer strFileRes.c_str(), // Filename "main", // Logical db name @@ -296,7 +293,7 @@ bool CDB::Rewrite(const string& strFile, const char* pszSkip) printf("Cannot create database file %s\n", strFileRes.c_str()); fSuccess = false; } - + Dbc* pcursor = db.GetCursor(); if (pcursor) while (fSuccess) |