mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 06:28:31 +01:00
walletdb: Introduce AddRef and RemoveRef functions
Refactor mapFileUseCount increment and decrement to separate functions AddRef and RemoveRef
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user