aboutsummaryrefslogtreecommitdiff
path: root/src/util/system.cpp
diff options
context:
space:
mode:
authorJoão Barbosa <[email protected]>2019-01-31 00:05:18 +0000
committerJoão Barbosa <[email protected]>2019-02-04 12:22:55 +0000
commit2f8b8f479bb43729ca2ff40929e8463347b0b7b4 (patch)
treed8ac8861dc68f4cfad476acd43d64e612c81792a /src/util/system.cpp
parentwallet: Close dbenv error file db.log (diff)
downloaddiscoin-2f8b8f479bb43729ca2ff40929e8463347b0b7b4.tar.xz
discoin-2f8b8f479bb43729ca2ff40929e8463347b0b7b4.zip
wallet: Close wallet env lock file
Close .walletlock file when a BerkeleyEnvironment is deleted.
Diffstat (limited to 'src/util/system.cpp')
-rw-r--r--src/util/system.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/util/system.cpp b/src/util/system.cpp
index 06317a3a9..d8b70ee52 100644
--- a/src/util/system.cpp
+++ b/src/util/system.cpp
@@ -116,6 +116,12 @@ bool LockDirectory(const fs::path& directory, const std::string lockfile_name, b
return true;
}
+void UnlockDirectory(const fs::path& directory, const std::string& lockfile_name)
+{
+ std::lock_guard<std::mutex> lock(cs_dir_locks);
+ dir_locks.erase((directory / lockfile_name).string());
+}
+
void ReleaseDirectoryLocks()
{
std::lock_guard<std::mutex> ulock(cs_dir_locks);