aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/bdb.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/wallet/bdb.h')
-rw-r--r--src/wallet/bdb.h12
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;