Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/bdb.h
Show First 20 Lines • Show All 118 Lines • ▼ Show 20 Lines | public: | ||||
~BerkeleyDatabase(); | ~BerkeleyDatabase(); | ||||
/** | /** | ||||
* Rewrite the entire database on disk, with the exception of key pszSkip if | * Rewrite the entire database on disk, with the exception of key pszSkip if | ||||
* non-zero | * non-zero | ||||
*/ | */ | ||||
bool Rewrite(const char *pszSkip = nullptr); | 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. | * Back up the entire database to a file. | ||||
*/ | */ | ||||
bool Backup(const std::string &strDest) const; | bool Backup(const std::string &strDest) const; | ||||
/** | /** | ||||
* Make sure all changes are flushed to database file. | * Make sure all changes are flushed to database file. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 86 Lines • ▼ Show 20 Lines | |||||
protected: | protected: | ||||
Db *pdb; | Db *pdb; | ||||
std::string strFile; | std::string strFile; | ||||
DbTxn *activeTxn; | DbTxn *activeTxn; | ||||
Dbc *m_cursor; | Dbc *m_cursor; | ||||
bool fReadOnly; | bool fReadOnly; | ||||
bool fFlushOnClose; | bool fFlushOnClose; | ||||
BerkeleyEnvironment *env; | BerkeleyEnvironment *env; | ||||
BerkeleyDatabase &m_database; | |||||
public: | public: | ||||
explicit BerkeleyBatch(BerkeleyDatabase &database, | explicit BerkeleyBatch(BerkeleyDatabase &database, | ||||
const char *pszMode = "r+", | const char *pszMode = "r+", | ||||
bool fFlushOnCloseIn = true); | bool fFlushOnCloseIn = true); | ||||
~BerkeleyBatch() override { Close(); } | ~BerkeleyBatch() override { Close(); } | ||||
BerkeleyBatch(const BerkeleyBatch &) = delete; | BerkeleyBatch(const BerkeleyBatch &) = delete; | ||||
Show All 15 Lines |