diff options
author | Chun Kuan Lee <ken2812221@gmail.com> | 2018-09-25 21:56:16 +0800 |
---|---|---|
committer | Chun Kuan Lee <ken2812221@gmail.com> | 2018-10-24 23:08:16 +0800 |
commit | 2d796faf62095e83f74337c26e7e1a8c3957cf3c (patch) | |
tree | 7bd309a07b5e4fa231a39521ff8cc33fcd3b58be /src/wallet/db.h | |
parent | 5c25409d6851182c5e351720cee36812c229b77a (diff) |
wallet: Fix duplicate fileid
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); |