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.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/wallet/db.cpp b/src/wallet/db.cpp
index cfa9bdd20e..99d880daa0 100644
--- a/src/wallet/db.cpp
+++ b/src/wallet/db.cpp
@@ -126,11 +126,18 @@ void BerkeleyEnvironment::Close()
}
}
+ FILE* error_file = nullptr;
+ dbenv->get_errfile(&error_file);
+
int ret = dbenv->close(0);
if (ret != 0)
LogPrintf("BerkeleyEnvironment::Close: Error %d closing database environment: %s\n", ret, DbEnv::strerror(ret));
if (!fMockDb)
DbEnv((u_int32_t)0).remove(strPath.c_str(), 0);
+
+ if (error_file) fclose(error_file);
+
+ UnlockDirectory(strPath, ".walletlock");
}
void BerkeleyEnvironment::Reset()
@@ -390,7 +397,7 @@ bool BerkeleyBatch::VerifyEnvironment(const fs::path& file_path, std::string& er
fs::path walletDir = env->Directory();
LogPrintf("Using BerkeleyDB version %s\n", DbEnv::version(nullptr, nullptr, nullptr));
- LogPrintf("Using wallet %s\n", walletFile);
+ LogPrintf("Using wallet %s\n", file_path.string());
// Wallet file must be a plain filename without a directory
if (walletFile != fs::basename(walletFile) + fs::extension(walletFile))