diff options
author | Andrew Chow <achow101-github@achow101.com> | 2020-06-19 20:51:07 -0400 |
---|---|---|
committer | Andrew Chow <achow101-github@achow101.com> | 2020-07-14 11:07:16 -0400 |
commit | 71d28e7cdca1c8553531bb3a4725d7916363ec5c (patch) | |
tree | 297581efdd39252282410442280cddcc61aa03e5 /src/wallet/bdb.h | |
parent | 27b27663849932971eb5deadb1f19234b9cd97ea (diff) |
walletdb: Introduce AddRef and RemoveRef functions
Refactor mapFileUseCount increment and decrement to separate functions
AddRef and RemoveRef
Diffstat (limited to 'src/wallet/bdb.h')
-rw-r--r-- | src/wallet/bdb.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/wallet/bdb.h b/src/wallet/bdb.h index 52cd9d92df..9c4d6afa87 100644 --- a/src/wallet/bdb.h +++ b/src/wallet/bdb.h @@ -121,6 +121,11 @@ public: */ bool Rewrite(const char* pszSkip=nullptr); + /** Indicate the a new database user has began using the database. */ + void AddRef(); + /** Indicate that database user has stopped using the database and that it could be flushed or closed. */ + void RemoveRef(); + /** Back up the entire database to a file. */ bool Backup(const std::string& strDest) const; @@ -212,6 +217,7 @@ protected: bool fReadOnly; bool fFlushOnClose; BerkeleyEnvironment *env; + BerkeleyDatabase& m_database; public: explicit BerkeleyBatch(BerkeleyDatabase& database, const char* pszMode = "r+", bool fFlushOnCloseIn=true); |