diff options
author | Kiminuo <kiminuo@protonmail.com> | 2021-12-02 21:21:05 +0100 |
---|---|---|
committer | Kiminuo <kiminuo@protonmail.com> | 2022-03-16 08:26:28 +0100 |
commit | 39b1763730177cd7d6a32fd9321da640b0d65e0e (patch) | |
tree | ce8d7c83579101fb27062410ed27283ee76558b9 /src/wallet/bdb.h | |
parent | a7e80449c0811b361cdaea39b6bab78ca5fbf668 (diff) |
Replace use of `ArgsManager` with `DatabaseOptions`
Co-authored-by: Russell Yanofsky <russ@yanofsky.org>
Diffstat (limited to 'src/wallet/bdb.h')
-rw-r--r-- | src/wallet/bdb.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/wallet/bdb.h b/src/wallet/bdb.h index b924890d81..fd6c76183e 100644 --- a/src/wallet/bdb.h +++ b/src/wallet/bdb.h @@ -32,8 +32,6 @@ struct bilingual_str; namespace wallet { -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]; @@ -56,8 +54,9 @@ public: std::map<std::string, std::reference_wrapper<BerkeleyDatabase>> m_databases; std::unordered_map<std::string, WalletDatabaseFileId> m_fileids; std::condition_variable_any m_db_in_use; + bool m_use_shared_memory; - explicit BerkeleyEnvironment(const fs::path& env_directory); + explicit BerkeleyEnvironment(const fs::path& env_directory, bool use_shared_memory); BerkeleyEnvironment(); ~BerkeleyEnvironment(); void Reset(); @@ -85,7 +84,7 @@ public: }; /** Get BerkeleyEnvironment given a directory path. */ -std::shared_ptr<BerkeleyEnvironment> GetBerkeleyEnv(const fs::path& env_directory); +std::shared_ptr<BerkeleyEnvironment> GetBerkeleyEnv(const fs::path& env_directory, bool use_shared_memory); class BerkeleyBatch; @@ -98,8 +97,8 @@ public: BerkeleyDatabase() = delete; /** Create DB handle to real database */ - BerkeleyDatabase(std::shared_ptr<BerkeleyEnvironment> env, std::string filename) : - WalletDatabase(), env(std::move(env)), strFile(std::move(filename)) + BerkeleyDatabase(std::shared_ptr<BerkeleyEnvironment> env, std::string filename, const DatabaseOptions& options) : + WalletDatabase(), env(std::move(env)), strFile(std::move(filename)), m_max_log_mb(options.max_log_mb) { auto inserted = this->env->m_databases.emplace(strFile, std::ref(*this)); assert(inserted.second); @@ -160,6 +159,7 @@ public: std::unique_ptr<Db> m_db; std::string strFile; + int64_t m_max_log_mb; /** Make a BerkeleyBatch connected to this database */ std::unique_ptr<DatabaseBatch> MakeBatch(bool flush_on_close = true) override; |