Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/db.h
Show First 20 Lines • Show All 172 Lines • ▼ Show 20 Lines | public: | ||||
* 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); | ||||
/** | /** | ||||
* Back up the entire database to a file. | * Back up the entire database to a file. | ||||
*/ | */ | ||||
bool Backup(const std::string &strDest); | bool Backup(const std::string &strDest) const; | ||||
/** | /** | ||||
* Make sure all changes are flushed to disk. | * Make sure all changes are flushed to disk. | ||||
*/ | */ | ||||
void Flush(bool shutdown); | void Flush(bool shutdown); | ||||
void IncrementUpdateCounter(); | void IncrementUpdateCounter(); | ||||
Show All 24 Lines | |||||
private: | private: | ||||
std::string strFile; | std::string strFile; | ||||
/** | /** | ||||
* Return whether this database handle is a dummy for testing. | * Return whether this database handle is a dummy for testing. | ||||
* Only to be used at a low level, application should ideally not care | * Only to be used at a low level, application should ideally not care | ||||
* about this. | * about this. | ||||
*/ | */ | ||||
bool IsDummy() { return env == nullptr; } | bool IsDummy() const { return env == nullptr; } | ||||
}; | }; | ||||
/** RAII class that provides access to a Berkeley database */ | /** RAII class that provides access to a Berkeley database */ | ||||
class BerkeleyBatch { | class BerkeleyBatch { | ||||
/** RAII class that automatically cleanses its data on destruction */ | /** RAII class that automatically cleanses its data on destruction */ | ||||
class SafeDbt final { | class SafeDbt final { | ||||
Dbt m_dbt; | Dbt m_dbt; | ||||
▲ Show 20 Lines • Show All 215 Lines • Show Last 20 Lines |