Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/walletdb.h
Show First 20 Lines • Show All 239 Lines • ▼ Show 20 Lines | bool WriteActiveScriptPubKeyMan(uint8_t type, const uint256 &id, | ||||
bool internal); | bool internal); | ||||
DBErrors LoadWallet(CWallet *pwallet); | DBErrors LoadWallet(CWallet *pwallet); | ||||
DBErrors FindWalletTx(std::vector<TxId> &txIds, | DBErrors FindWalletTx(std::vector<TxId> &txIds, | ||||
std::vector<CWalletTx> &vWtx); | std::vector<CWalletTx> &vWtx); | ||||
DBErrors ZapWalletTx(std::vector<CWalletTx> &vWtx); | DBErrors ZapWalletTx(std::vector<CWalletTx> &vWtx); | ||||
DBErrors ZapSelectTx(std::vector<TxId> &txIdsIn, | DBErrors ZapSelectTx(std::vector<TxId> &txIdsIn, | ||||
std::vector<TxId> &txIdsOut); | std::vector<TxId> &txIdsOut); | ||||
/* Try to (very carefully!) recover wallet database (with a possible key | |||||
* type filter) */ | |||||
static bool Recover(const fs::path &wallet_path, void *callbackDataIn, | |||||
bool (*recoverKVcallback)(void *callbackData, | |||||
CDataStream ssKey, | |||||
CDataStream ssValue), | |||||
std::string &out_backup_filename); | |||||
/* Recover convenience-function to bypass the key filter callback, called | |||||
* when verify fails, recovers everything */ | |||||
static bool Recover(const fs::path &wallet_path, | |||||
std::string &out_backup_filename); | |||||
/* Recover filter (used as callback), will only let keys (cryptographical | |||||
* keys) as KV/key-type pass through */ | |||||
static bool RecoverKeysOnlyFilter(void *callbackData, CDataStream ssKey, | |||||
CDataStream ssValue); | |||||
/* Function to determine if a certain KV/key-type is a key (cryptographical | /* Function to determine if a certain KV/key-type is a key (cryptographical | ||||
* key) type */ | * key) type */ | ||||
static bool IsKeyType(const std::string &strType); | static bool IsKeyType(const std::string &strType); | ||||
/* verifies the database environment */ | /* verifies the database environment */ | ||||
static bool VerifyEnvironment(const fs::path &wallet_path, | static bool VerifyEnvironment(const fs::path &wallet_path, | ||||
bilingual_str &errorStr); | bilingual_str &errorStr); | ||||
/* verifies the database file */ | /* verifies the database file */ | ||||
static bool VerifyDatabaseFile(const fs::path &wallet_path, | static bool VerifyDatabaseFile(const fs::path &wallet_path, | ||||
Show All 18 Lines | |||||
//! 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(); | ||||
//! Unserialize a given Key-Value pair and load it into the wallet | //! Unserialize a given Key-Value pair and load it into the wallet | ||||
bool ReadKeyValue(CWallet *pwallet, CDataStream &ssKey, CDataStream &ssValue, | bool ReadKeyValue(CWallet *pwallet, CDataStream &ssKey, CDataStream &ssValue, | ||||
std::string &strType, std::string &strErr); | std::string &strType, std::string &strErr); | ||||
/* Recover filter (used as callback), will only let keys (cryptographical keys) | |||||
* as KV/key-type pass through */ | |||||
bool RecoverKeysOnlyFilter(void *callbackData, CDataStream ssKey, | |||||
CDataStream ssValue); | |||||
#endif // BITCOIN_WALLET_WALLETDB_H | #endif // BITCOIN_WALLET_WALLETDB_H |