Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/bdb.h
Show First 20 Lines • Show All 84 Lines • ▼ Show 20 Lines | |||||
/** Get BerkeleyEnvironment and database filename given a wallet path. */ | /** Get BerkeleyEnvironment and database filename given a wallet path. */ | ||||
std::shared_ptr<BerkeleyEnvironment> | std::shared_ptr<BerkeleyEnvironment> | ||||
GetWalletEnv(const fs::path &wallet_path, std::string &database_filename); | GetWalletEnv(const fs::path &wallet_path, std::string &database_filename); | ||||
/** Return whether a BDB wallet database is currently loaded. */ | /** Return whether a BDB wallet database is currently loaded. */ | ||||
bool IsBDBWalletLoaded(const fs::path &wallet_path); | bool IsBDBWalletLoaded(const fs::path &wallet_path); | ||||
class BerkeleyBatch; | |||||
/** | /** | ||||
* An instance of this class represents one database. | * An instance of this class represents one database. | ||||
* For BerkeleyDB this is just a (env, strFile) tuple. | * For BerkeleyDB this is just a (env, strFile) tuple. | ||||
*/ | */ | ||||
class BerkeleyDatabase { | class BerkeleyDatabase { | ||||
friend class BerkeleyBatch; | friend class BerkeleyBatch; | ||||
public: | public: | ||||
▲ Show 20 Lines • Show All 66 Lines • ▼ Show 20 Lines | public: | ||||
std::shared_ptr<BerkeleyEnvironment> env; | std::shared_ptr<BerkeleyEnvironment> env; | ||||
/** | /** | ||||
* Database pointer. This is initialized lazily and reset during flushes, | * Database pointer. This is initialized lazily and reset during flushes, | ||||
* so it can be null. | * so it can be null. | ||||
*/ | */ | ||||
std::unique_ptr<Db> m_db; | std::unique_ptr<Db> m_db; | ||||
/** Make a BerkeleyBatch connected to this database */ | |||||
std::unique_ptr<BerkeleyBatch> MakeBatch(const char *mode, | |||||
bool flush_on_close); | |||||
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. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 62 Lines • Show Last 20 Lines |