aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/db.h
diff options
context:
space:
mode:
authorAndrew Chow <achow101-github@achow101.com>2018-02-20 15:28:42 -0500
committerAndrew Chow <achow101-github@achow101.com>2018-08-09 11:27:39 -0700
commit5d296ac810755dc47f105eb95b52b7e2bcb8aea8 (patch)
tree9a3ffe538c0216ee958811d4d1a041c41d7deb72 /src/wallet/db.h
parenta769461d5e37ddcb771ae836254fdc69177a28c4 (diff)
Add function to close all Db's and reload the databae environment
Adds a ReloadDbEnv function to BerkeleyEnvironment in order to close all Db instances, closes the environment, resets it, and then reopens the BerkeleyEnvironment. Also adds a ReloadDbEnv function to BerkeleyDatabase that calls BerkeleyEnvironment's ReloadDbEnv.
Diffstat (limited to 'src/wallet/db.h')
-rw-r--r--src/wallet/db.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/wallet/db.h b/src/wallet/db.h
index b078edab7b..467ed13b45 100644
--- a/src/wallet/db.h
+++ b/src/wallet/db.h
@@ -38,6 +38,7 @@ public:
std::unique_ptr<DbEnv> dbenv;
std::map<std::string, int> mapFileUseCount;
std::map<std::string, Db*> mapDb;
+ std::condition_variable_any m_db_in_use;
BerkeleyEnvironment(const fs::path& env_directory);
~BerkeleyEnvironment();
@@ -75,6 +76,7 @@ public:
void CheckpointLSN(const std::string& strFile);
void CloseDb(const std::string& strFile);
+ void ReloadDbEnv();
DbTxn* TxnBegin(int flags = DB_TXN_WRITE_NOSYNC)
{
@@ -145,6 +147,8 @@ public:
void IncrementUpdateCounter();
+ void ReloadDbEnv();
+
std::atomic<unsigned int> nUpdateCounter;
unsigned int nLastSeen;
unsigned int nLastFlushed;