mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-24 22:45:41 +01:00
Merge #15297: wallet: Releases dangling files on BerkeleyEnvironment::Close
d3bf3b930qa: Test .walletlock file is closed (João Barbosa)2f8b8f479wallet: Close wallet env lock file (João Barbosa)8602a1e6awallet: Close dbenv error file db.log (João Barbosa) Pull request description: This PR closes `db.log` and removes `.walletlock` files when `BerkeleyEnvironment` is closed. Fixes https://github.com/bitcoin/bitcoin/issues/15291#issuecomment-459131886. Tree-SHA512: 05d8b027feea914e0ba873e75d117857473d1fd7b400e41bd473d638171fa39d5be048990bf685dc0807f7d92418579b763056dc2a6dcf6b96777d5688ddee04
This commit is contained in:
@@ -111,6 +111,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);
|
||||
|
||||
Reference in New Issue
Block a user