![]() |
Master Core
v0.0.9 - 2abfd2849db8ba7a83957c64eb976b406713c123
|
#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 | MakeMock () |
bool | IsMock () |
VerifyResult | Verify (std::string strFile, bool(*recoverFunc)(CDBEnv &dbenv, std::string strFile)) |
bool | Salvage (std::string strFile, bool fAggressive, std::vector< KeyValPair > &vResult) |
bool | Open (const boost::filesystem::path &path) |
void | Close () |
void | Flush (bool fShutdown) |
void | CheckpointLSN (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 |
boost::filesystem::path | path |
typedef std::pair<std::vector<unsigned char>, std::vector<unsigned char> > CDBEnv::KeyValPair |
enum CDBEnv::VerifyResult |
CDBEnv::CDBEnv | ( | ) |
Definition at line 50 of file db.cpp.
References fDbEnvInit, and fMockDb.
CDBEnv::~CDBEnv | ( | ) |
Definition at line 56 of file db.cpp.
References EnvShutdown().
void CDBEnv::CheckpointLSN | ( | std::string | strFile | ) |
Definition at line 215 of file db.cpp.
References dbenv, and fMockDb.
Referenced by BackupWallet(), CDB::Rewrite(), and ThreadFlushWalletDB().
void CDBEnv::Close | ( | ) |
Definition at line 61 of file db.cpp.
References EnvShutdown().
Referenced by Flush().
void CDBEnv::CloseDb | ( | const std::string & | strFile | ) |
Definition at line 317 of file db.cpp.
References cs_db, LOCK, and mapDb.
Referenced by BackupWallet(), Flush(), RemoveDb(), CDB::Rewrite(), and ThreadFlushWalletDB().
|
private |
void CDBEnv::Flush | ( | bool | fShutdown | ) |
Definition at line 435 of file db.cpp.
References Close(), CloseDb(), cs_db, dbenv, fDbEnvInit, fMockDb, GetTimeMillis(), LOCK, LogPrint(), mapFileUseCount, and path.
Referenced by Shutdown().
|
inline |
Definition at line 48 of file db.h.
References fMockDb.
Referenced by CDB::CDB().
void CDBEnv::MakeMock | ( | ) |
Definition at line 111 of file db.cpp.
References dbenv, fDbEnvInit, fMockDb, LogPrint(), and strprintf.
bool CDBEnv::Open | ( | const boost::filesystem::path & | path | ) |
debug
Definition at line 66 of file db.cpp.
References dbenv, error(), fDbEnvInit, fMockDb, GetBoolArg(), LogPrintf, path, and TryCreateDirectory().
Referenced by AppInit2(), and CDB::CDB().
bool CDBEnv::RemoveDb | ( | const std::string & | strFile | ) |
bool CDBEnv::Salvage | ( | std::string | strFile, |
bool | fAggressive, | ||
std::vector< KeyValPair > & | vResult | ||
) |
Definition at line 160 of file db.cpp.
References cs_db, dbenv, LOCK, LogPrintf, mapFileUseCount, and ParseHex().
Referenced by CWalletDB::Recover().
|
inline |
Definition at line 76 of file db.h.
Referenced by CWalletDB::Recover(), and CDB::TxnBegin().
CDBEnv::VerifyResult CDBEnv::Verify | ( | std::string | strFile, |
bool(*)(CDBEnv &dbenv, std::string strFile) | recoverFunc | ||
) |
Definition at line 143 of file db.cpp.
References cs_db, LOCK, mapFileUseCount, RECOVER_FAIL, RECOVER_OK, and VERIFY_OK.
Referenced by AppInit2().
|
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(), and Salvage().
|
private |
|
private |
Definition at line 34 of file db.h.
Referenced by CDBEnv(), 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 |