Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/db.h
Show All 15 Lines | |||||
#include <atomic> | #include <atomic> | ||||
#include <map> | #include <map> | ||||
#include <memory> | #include <memory> | ||||
#include <string> | #include <string> | ||||
#include <unordered_map> | #include <unordered_map> | ||||
#include <vector> | #include <vector> | ||||
struct bilingual_str; | |||||
static const unsigned int DEFAULT_WALLET_DBLOGSIZE = 100; | static const unsigned int DEFAULT_WALLET_DBLOGSIZE = 100; | ||||
static const bool DEFAULT_WALLET_PRIVDB = true; | static const bool DEFAULT_WALLET_PRIVDB = true; | ||||
struct WalletDatabaseFileId { | struct WalletDatabaseFileId { | ||||
u_int8_t value[DB_FILE_ID_LEN]; | u_int8_t value[DB_FILE_ID_LEN]; | ||||
bool operator==(const WalletDatabaseFileId &rhs) const; | bool operator==(const WalletDatabaseFileId &rhs) const; | ||||
}; | }; | ||||
▲ Show 20 Lines • Show All 234 Lines • ▼ Show 20 Lines | static bool Recover(const fs::path &file_path, void *callbackDataIn, | ||||
CDataStream ssValue), | CDataStream ssValue), | ||||
std::string &out_backup_filename); | std::string &out_backup_filename); | ||||
/* flush the wallet passively (TRY_LOCK) | /* flush the wallet passively (TRY_LOCK) | ||||
ideal to be called periodically */ | ideal to be called periodically */ | ||||
static bool PeriodicFlush(BerkeleyDatabase &database); | static bool PeriodicFlush(BerkeleyDatabase &database); | ||||
/* verifies the database environment */ | /* verifies the database environment */ | ||||
static bool VerifyEnvironment(const fs::path &file_path, | static bool VerifyEnvironment(const fs::path &file_path, | ||||
std::string &errorStr); | bilingual_str &errorStr); | ||||
/* verifies the database file */ | /* verifies the database file */ | ||||
static bool | static bool | ||||
VerifyDatabaseFile(const fs::path &file_path, | VerifyDatabaseFile(const fs::path &file_path, | ||||
std::vector<std::string> &warnings, | std::vector<bilingual_str> &warnings, | ||||
std::string &errorStr, | bilingual_str &errorStr, | ||||
BerkeleyEnvironment::recoverFunc_type recoverFunc); | BerkeleyEnvironment::recoverFunc_type recoverFunc); | ||||
template <typename K, typename T> bool Read(const K &key, T &value) { | template <typename K, typename T> bool Read(const K &key, T &value) { | ||||
if (!pdb) { | if (!pdb) { | ||||
return false; | return false; | ||||
} | } | ||||
// Key | // Key | ||||
▲ Show 20 Lines • Show All 156 Lines • Show Last 20 Lines |