Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/walletdb.h
Show First 20 Lines • Show All 156 Lines • ▼ Show 20 Lines | template <typename K> bool EraseIC(const K &key) { | ||||
m_dbw.IncrementUpdateCounter(); | m_dbw.IncrementUpdateCounter(); | ||||
return true; | return true; | ||||
} | } | ||||
public: | public: | ||||
explicit CWalletDB(CWalletDBWrapper &dbw, const char *pszMode = "r+", | explicit CWalletDB(CWalletDBWrapper &dbw, const char *pszMode = "r+", | ||||
bool _fFlushOnClose = true) | bool _fFlushOnClose = true) | ||||
: batch(dbw, pszMode, _fFlushOnClose), m_dbw(dbw) {} | : batch(dbw, pszMode, _fFlushOnClose), m_dbw(dbw) {} | ||||
CWalletDB(const CWalletDB &) = delete; | |||||
CWalletDB &operator=(const CWalletDB &) = delete; | |||||
bool WriteName(const CTxDestination &address, const std::string &strName); | bool WriteName(const CTxDestination &address, const std::string &strName); | ||||
bool EraseName(const CTxDestination &address); | bool EraseName(const CTxDestination &address); | ||||
bool WritePurpose(const CTxDestination &address, | bool WritePurpose(const CTxDestination &address, | ||||
const std::string &purpose); | const std::string &purpose); | ||||
bool ErasePurpose(const CTxDestination &address); | bool ErasePurpose(const CTxDestination &address); | ||||
▲ Show 20 Lines • Show All 87 Lines • ▼ Show 20 Lines | public: | ||||
//! Read wallet version | //! Read wallet version | ||||
bool ReadVersion(int &nVersion); | bool ReadVersion(int &nVersion); | ||||
//! Write wallet version | //! Write wallet version | ||||
bool WriteVersion(int nVersion); | bool WriteVersion(int nVersion); | ||||
private: | private: | ||||
CDB batch; | CDB batch; | ||||
CWalletDBWrapper &m_dbw; | CWalletDBWrapper &m_dbw; | ||||
CWalletDB(const CWalletDB &); | |||||
void operator=(const CWalletDB &); | |||||
}; | }; | ||||
//! Compacts BDB state so that wallet.dat is self-contained (if there are | //! Compacts BDB state so that wallet.dat is self-contained (if there are | ||||
//! changes) | //! changes) | ||||
void MaybeCompactWalletDB(); | void MaybeCompactWalletDB(); | ||||
#endif // BITCOIN_WALLET_WALLETDB_H | #endif // BITCOIN_WALLET_WALLETDB_H |