diff options
author | Chun Kuan Lee <ken2812221@gmail.com> | 2018-09-25 21:56:16 +0800 |
---|---|---|
committer | João Barbosa <joao.paulo.barbosa@gmail.com> | 2019-03-11 21:54:44 +0000 |
commit | 8965b6ab4753f3223d90d9c1ab03b190f0320dd8 (patch) | |
tree | 356adc2701b26b85ed80ac66f1a5e83ebb2b4a52 /src/wallet/db.h | |
parent | 16e57594556ac481a32f5d5ed1a988b2772ba804 (diff) |
wallet: Fix duplicate fileid
Github-Pull: #14320
Rebased-From: 2d796fa
Diffstat (limited to 'src/wallet/db.h')
-rw-r--r-- | src/wallet/db.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/wallet/db.h b/src/wallet/db.h index 467ed13b45..68a59607ae 100644 --- a/src/wallet/db.h +++ b/src/wallet/db.h @@ -18,6 +18,7 @@ #include <map> #include <memory> #include <string> +#include <unordered_map> #include <vector> #include <db_cxx.h> @@ -25,6 +26,11 @@ static const unsigned int DEFAULT_WALLET_DBLOGSIZE = 100; static const bool DEFAULT_WALLET_PRIVDB = true; +struct WalletDatabaseFileId { + u_int8_t value[DB_FILE_ID_LEN]; + bool operator==(const WalletDatabaseFileId& rhs) const; +}; + class BerkeleyEnvironment { private: @@ -38,6 +44,7 @@ public: std::unique_ptr<DbEnv> dbenv; std::map<std::string, int> mapFileUseCount; std::map<std::string, Db*> mapDb; + std::unordered_map<std::string, WalletDatabaseFileId> m_fileids; std::condition_variable_any m_db_in_use; BerkeleyEnvironment(const fs::path& env_directory); |