diff --git a/src/wallet/db.cpp b/src/wallet/db.cpp --- a/src/wallet/db.cpp +++ b/src/wallet/db.cpp @@ -226,6 +226,7 @@ CDB::CDB(const std::string &strFilename, const char *pszMode, bool fFlushOnCloseIn) : pdb(nullptr), activeTxn(nullptr) { + int ret; fReadOnly = (!strchr(pszMode, '+') && !strchr(pszMode, 'w')); fFlushOnClose = fFlushOnCloseIn; if (strFilename.empty()) return; @@ -235,7 +236,6 @@ if (fCreate) nFlags |= DB_CREATE; { - int ret; LOCK(bitdb.cs_db); if (!bitdb.Open(GetDataDir())) throw std::runtime_error("CDB: Failed to open database environment.");