![]() |
Dash Core
0.12.2.1
P2P Digital Currency
|
#include <db.h>
Public Types | |
enum | VerifyResult { VERIFY_OK, RECOVER_OK, RECOVER_FAIL } |
typedef std::pair< std::vector< unsigned char >, std::vector< unsigned char > > | KeyValPair |
Public Member Functions | |
CDBEnv () | |
~CDBEnv () | |
void | Reset () |
void | MakeMock () |
bool | IsMock () |
VerifyResult | Verify (const std::string &strFile, bool(*recoverFunc)(CDBEnv &dbenv, const std::string &strFile)) |
bool | Salvage (const std::string &strFile, bool fAggressive, std::vector< KeyValPair > &vResult) |
bool | Open (const boost::filesystem::path &path) |
void | Close () |
void | Flush (bool fShutdown) |
void | CheckpointLSN (const std::string &strFile) |
void | CloseDb (const std::string &strFile) |
bool | RemoveDb (const std::string &strFile) |
DbTxn * | TxnBegin (int flags=DB_TXN_WRITE_NOSYNC) |
Public Attributes | |
CCriticalSection | cs_db |
DbEnv * | dbenv |
std::map< std::string, int > | mapFileUseCount |
std::map< std::string, Db * > | mapDb |
Private Member Functions | |
void | EnvShutdown () |
Private Attributes | |
bool | fDbEnvInit |
bool | fMockDb |
std::string | strPath |
typedef std::pair<std::vector<unsigned char>, std::vector<unsigned char> > CDBEnv::KeyValPair |
Salvage data from a file that Verify says is bad. fAggressive sets the DB_AGGRESSIVE flag (see berkeley DB->verify() method documentation). Appends binary key/value pairs to vResult, returns true if successful. NOTE: reads the entire database into memory, so cannot be used for huge databases.
enum CDBEnv::VerifyResult |
void CDBEnv::CheckpointLSN | ( | const std::string & | strFile | ) |
Definition at line 218 of file db.cpp.
Referenced by BackupWallet(), CDB::Rewrite(), and ThreadFlushWalletDB().
void CDBEnv::CloseDb | ( | const std::string & | strFile | ) |
Definition at line 317 of file db.cpp.
Referenced by BackupWallet(), Flush(), RemoveDb(), CDB::Rewrite(), and ThreadFlushWalletDB().
|
private |
void CDBEnv::Flush | ( | bool | fShutdown | ) |
Definition at line 424 of file db.cpp.
Referenced by CWallet::Flush().
|
inline |
Definition at line 50 of file db.h.
Referenced by CDB::CDB().
bool CDBEnv::Open | ( | const boost::filesystem::path & | path | ) |
bool CDBEnv::Salvage | ( | const std::string & | strFile, |
bool | fAggressive, | ||
std::vector< KeyValPair > & | vResult | ||
) |
Definition at line 168 of file db.cpp.
Referenced by CWalletDB::Recover().
|
inline |
Definition at line 80 of file db.h.
Referenced by CWalletDB::Recover(), and CDB::TxnBegin().
CDBEnv::VerifyResult CDBEnv::Verify | ( | const std::string & | strFile, |
bool(*)(CDBEnv &dbenv, const std::string &strFile) | recoverFunc | ||
) |
Definition at line 151 of file db.cpp.
Referenced by CWallet::Verify().
|
mutable |
Definition at line 40 of file db.h.
Referenced by BackupWallet(), CDB::CDB(), CDB::Close(), CloseDb(), Flush(), RemoveDb(), CDB::Rewrite(), Salvage(), ThreadFlushWalletDB(), and Verify().
DbEnv* CDBEnv::dbenv |
Definition at line 41 of file db.h.
Referenced by CDB::CDB(), CheckpointLSN(), Flush(), CDB::Flush(), MakeMock(), Open(), CWalletDB::Recover(), RemoveDb(), CDB::Rewrite(), Salvage(), TxnBegin(), Verify(), and ~CDBEnv().
|
private |
Definition at line 31 of file db.h.
Referenced by Flush(), MakeMock(), and Open().
|
private |
Definition at line 32 of file db.h.
Referenced by CheckpointLSN(), Flush(), IsMock(), MakeMock(), and Open().
std::map<std::string, Db*> CDBEnv::mapDb |
Definition at line 43 of file db.h.
Referenced by CDB::CDB(), and CloseDb().
std::map<std::string, int> CDBEnv::mapFileUseCount |
Definition at line 42 of file db.h.
Referenced by BackupWallet(), CDB::CDB(), CDB::Close(), Flush(), CDB::Rewrite(), Salvage(), ThreadFlushWalletDB(), and Verify().
|
private |