diff options
author | João Barbosa <joao.paulo.barbosa@gmail.com> | 2019-02-01 21:09:13 +0000 |
---|---|---|
committer | João Barbosa <joao.paulo.barbosa@gmail.com> | 2019-02-01 21:13:08 +0000 |
commit | 712d35bc563ac7de0b7dfc3a35fc48dc6448fa6a (patch) | |
tree | d7d4bdadfc9a51446178bab706f26201e48cc2a7 /src | |
parent | efb6ddef9cb341428cbedf4373d1bdd19685a827 (diff) |
wallet: Add missing cs_db lock
Without this lock BerkeleyEnvironment::~BerkeleyEnvironment and
GetWalletEnv would race for g_dbenvs. This wasn't detected before
because thread safety analysis does not check constructors and
destructors.
Diffstat (limited to 'src')
-rw-r--r-- | src/wallet/db.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/wallet/db.cpp b/src/wallet/db.cpp index ae40553268..cfa9bdd20e 100644 --- a/src/wallet/db.cpp +++ b/src/wallet/db.cpp @@ -147,6 +147,7 @@ BerkeleyEnvironment::BerkeleyEnvironment(const fs::path& dir_path) : strPath(dir BerkeleyEnvironment::~BerkeleyEnvironment() { + LOCK(cs_db); g_dbenvs.erase(strPath); Close(); } |