![]() |
Master Core
v0.0.9 - 2abfd2849db8ba7a83957c64eb976b406713c123
|
Access to the wallet database (wallet.dat) More...
#include <walletdb.h>
Public Member Functions | |
CWalletDB (std::string strFilename, const char *pszMode="r+") | |
bool | WriteName (const std::string &strAddress, const std::string &strName) |
bool | EraseName (const std::string &strAddress) |
bool | WritePurpose (const std::string &strAddress, const std::string &purpose) |
bool | ErasePurpose (const std::string &strAddress) |
bool | WriteTx (uint256 hash, const CWalletTx &wtx) |
bool | EraseTx (uint256 hash) |
bool | WriteKey (const CPubKey &vchPubKey, const CPrivKey &vchPrivKey, const CKeyMetadata &keyMeta) |
bool | WriteCryptedKey (const CPubKey &vchPubKey, const std::vector< unsigned char > &vchCryptedSecret, const CKeyMetadata &keyMeta) |
bool | WriteMasterKey (unsigned int nID, const CMasterKey &kMasterKey) |
bool | WriteCScript (const uint160 &hash, const CScript &redeemScript) |
bool | WriteBestBlock (const CBlockLocator &locator) |
bool | ReadBestBlock (CBlockLocator &locator) |
bool | WriteOrderPosNext (int64_t nOrderPosNext) |
bool | WriteDefaultKey (const CPubKey &vchPubKey) |
bool | ReadPool (int64_t nPool, CKeyPool &keypool) |
bool | WritePool (int64_t nPool, const CKeyPool &keypool) |
bool | ErasePool (int64_t nPool) |
bool | WriteMinVersion (int nVersion) |
bool | ReadAccount (const std::string &strAccount, CAccount &account) |
bool | WriteAccount (const std::string &strAccount, const CAccount &account) |
bool | WriteDestData (const std::string &address, const std::string &key, const std::string &value) |
Write destination data key,value tuple to database. More... | |
bool | EraseDestData (const std::string &address, const std::string &key) |
Erase destination data tuple from wallet database. More... | |
bool | WriteAccountingEntry (const CAccountingEntry &acentry) |
int64_t | GetAccountCreditDebit (const std::string &strAccount) |
void | ListAccountCreditDebit (const std::string &strAccount, std::list< CAccountingEntry > &acentries) |
DBErrors | ReorderTransactions (CWallet *) |
DBErrors | LoadWallet (CWallet *pwallet) |
DBErrors | FindWalletTx (CWallet *pwallet, std::vector< uint256 > &vTxHash) |
DBErrors | ZapWalletTx (CWallet *pwallet) |
![]() | |
void | Flush () |
void | Close () |
bool | TxnBegin () |
bool | TxnCommit () |
bool | TxnAbort () |
bool | ReadVersion (int &nVersion) |
bool | WriteVersion (int nVersion) |
Static Public Member Functions | |
static bool | Recover (CDBEnv &dbenv, std::string filename, bool fOnlyKeys) |
static bool | Recover (CDBEnv &dbenv, std::string filename) |
![]() | |
static bool | Rewrite (const std::string &strFile, const char *pszSkip=NULL) |
Private Member Functions | |
CWalletDB (const CWalletDB &) | |
void | operator= (const CWalletDB &) |
bool | WriteAccountingEntry (const uint64_t nAccEntryNum, const CAccountingEntry &acentry) |
Additional Inherited Members | |
![]() | |
CDB (const char *pszFile, const char *pszMode="r+") | |
~CDB () | |
template<typename K , typename T > | |
bool | Read (const K &key, T &value) |
template<typename K , typename T > | |
bool | Write (const K &key, const T &value, bool fOverwrite=true) |
template<typename K > | |
bool | Erase (const K &key) |
template<typename K > | |
bool | Exists (const K &key) |
Dbc * | GetCursor () |
int | ReadAtCursor (Dbc *pcursor, CDataStream &ssKey, CDataStream &ssValue, unsigned int fFlags=DB_NEXT) |
![]() | |
Db * | pdb |
std::string | strFile |
DbTxn * | activeTxn |
bool | fReadOnly |
Access to the wallet database (wallet.dat)
Definition at line 71 of file walletdb.h.
|
inline |
Definition at line 74 of file walletdb.h.
|
private |
bool CWalletDB::EraseDestData | ( | const std::string & | address, |
const std::string & | key | ||
) |
Erase destination data tuple from wallet database.
Definition at line 957 of file walletdb.cpp.
References nWalletDBUpdated.
Referenced by CWallet::DelAddressBook(), and CWallet::EraseDestData().
bool CWalletDB::EraseName | ( | const std::string & | strAddress | ) |
Definition at line 33 of file walletdb.cpp.
References nWalletDBUpdated.
Referenced by CWallet::DelAddressBook().
bool CWalletDB::ErasePool | ( | int64_t | nPool | ) |
Definition at line 149 of file walletdb.cpp.
References nWalletDBUpdated.
Referenced by CWallet::KeepKey(), and CWallet::NewKeyPool().
bool CWalletDB::ErasePurpose | ( | const std::string & | strAddress | ) |
Definition at line 47 of file walletdb.cpp.
References nWalletDBUpdated.
Referenced by CWallet::DelAddressBook().
bool CWalletDB::EraseTx | ( | uint256 | hash | ) |
Definition at line 59 of file walletdb.cpp.
References nWalletDBUpdated.
Referenced by CWallet::EraseFromWallet().
Definition at line 683 of file walletdb.cpp.
References CLIENT_VERSION, CWallet::cs_wallet, DB_CORRUPT, DB_LOAD_OK, DB_NONCRITICAL_ERROR, DB_TOO_NEW, CWallet::LoadMinVersion(), LOCK, LogPrintf, SER_DISK, and CWallet::vchDefaultKey.
int64_t CWalletDB::GetAccountCreditDebit | ( | const std::string & | strAccount | ) |
Definition at line 181 of file walletdb.cpp.
References CAccountingEntry::nCreditDebit.
Referenced by GetAccountBalance().
void CWalletDB::ListAccountCreditDebit | ( | const std::string & | strAccount, |
std::list< CAccountingEntry > & | acentries | ||
) |
Definition at line 193 of file walletdb.cpp.
References CLIENT_VERSION, SER_DISK, and CAccountingEntry::strAccount.
Referenced by listaccounts(), and CWallet::OrderedTxItems().
Definition at line 582 of file walletdb.cpp.
References CLIENT_VERSION, CWallet::cs_wallet, DB_CORRUPT, DB_LOAD_OK, DB_NEED_REWRITE, DB_NONCRITICAL_ERROR, DB_TOO_NEW, CWalletScanState::fAnyUnordered, CWalletScanState::fIsEncrypted, IsKeyType(), CWallet::LoadMinVersion(), LOCK, LogPrintf, CWallet::mapWallet, CWalletScanState::nCKeys, CWalletScanState::nFileVersion, CWalletScanState::nKeyMeta, CWalletScanState::nKeys, CWallet::nTimeFirstKey, ReadKeyValue(), SER_DISK, SoftSetBoolArg(), CWallet::vchDefaultKey, and CWalletScanState::vWalletUpgrade.
Referenced by CWallet::LoadWallet().
|
private |
bool CWalletDB::ReadAccount | ( | const std::string & | strAccount, |
CAccount & | account | ||
) |
Definition at line 160 of file walletdb.cpp.
References CAccount::SetNull().
Referenced by GetAccountAddress().
bool CWalletDB::ReadBestBlock | ( | CBlockLocator & | locator | ) |
Definition at line 121 of file walletdb.cpp.
Referenced by AppInit2().
bool CWalletDB::ReadPool | ( | int64_t | nPool, |
CKeyPool & | keypool | ||
) |
Definition at line 138 of file walletdb.cpp.
Referenced by CWallet::GetAllReserveKeys(), and CWallet::ReserveKeyFromKeyPool().
|
static |
Definition at line 868 of file walletdb.cpp.
References CLIENT_VERSION, CDBEnv::dbenv, GetTime(), IsKeyType(), LogPrintf, ReadKeyValue(), CDBEnv::Salvage(), SER_DISK, strprintf, and CDBEnv::TxnBegin().
Referenced by AppInit2(), and Recover().
|
static |
Definition at line 946 of file walletdb.cpp.
References Recover().
Definition at line 238 of file walletdb.cpp.
References CWallet::cs_wallet, DB_LOAD_FAIL, DB_LOAD_OK, CTransaction::GetHash(), LOCK, CWallet::mapWallet, CAccountingEntry::nEntryNo, CWalletTx::nOrderPos, CAccountingEntry::nOrderPos, CWallet::nOrderPosNext, CAccountingEntry::nTime, and CWalletTx::nTimeReceived.
bool CWalletDB::WriteAccount | ( | const std::string & | strAccount, |
const CAccount & | account | ||
) |
Definition at line 166 of file walletdb.cpp.
Referenced by GetAccountAddress().
|
private |
Definition at line 171 of file walletdb.cpp.
References CAccountingEntry::strAccount.
Referenced by movecmd().
bool CWalletDB::WriteAccountingEntry | ( | const CAccountingEntry & | acentry | ) |
Definition at line 176 of file walletdb.cpp.
References nAccountingEntryNumber.
bool CWalletDB::WriteBestBlock | ( | const CBlockLocator & | locator | ) |
Definition at line 115 of file walletdb.cpp.
References nWalletDBUpdated.
Referenced by CWallet::SetBestChain().
bool CWalletDB::WriteCryptedKey | ( | const CPubKey & | vchPubKey, |
const std::vector< unsigned char > & | vchCryptedSecret, | ||
const CKeyMetadata & | keyMeta | ||
) |
Definition at line 82 of file walletdb.cpp.
References nWalletDBUpdated.
Referenced by CWallet::AddCryptedKey().
Definition at line 109 of file walletdb.cpp.
References nWalletDBUpdated.
Referenced by CWallet::AddCScript().
bool CWalletDB::WriteDefaultKey | ( | const CPubKey & | vchPubKey | ) |
Definition at line 132 of file walletdb.cpp.
References nWalletDBUpdated.
bool CWalletDB::WriteDestData | ( | const std::string & | address, |
const std::string & | key, | ||
const std::string & | value | ||
) |
Write destination data key,value tuple to database.
Definition at line 951 of file walletdb.cpp.
References nWalletDBUpdated.
Referenced by CWallet::AddDestData().
bool CWalletDB::WriteKey | ( | const CPubKey & | vchPubKey, |
const CPrivKey & | vchPrivKey, | ||
const CKeyMetadata & | keyMeta | ||
) |
Definition at line 65 of file walletdb.cpp.
References CPubKey::begin(), CPubKey::end(), Hash(), nWalletDBUpdated, and CPubKey::size().
Referenced by CWallet::AddKeyPubKey().
bool CWalletDB::WriteMasterKey | ( | unsigned int | nID, |
const CMasterKey & | kMasterKey | ||
) |
Definition at line 103 of file walletdb.cpp.
References nWalletDBUpdated.
Referenced by CWallet::ChangeWalletPassphrase().
bool CWalletDB::WriteMinVersion | ( | int | nVersion | ) |
Definition at line 155 of file walletdb.cpp.
Referenced by CWallet::SetMinVersion().
bool CWalletDB::WriteName | ( | const std::string & | strAddress, |
const std::string & | strName | ||
) |
Definition at line 27 of file walletdb.cpp.
References nWalletDBUpdated.
Referenced by CWallet::SetAddressBook().
bool CWalletDB::WriteOrderPosNext | ( | int64_t | nOrderPosNext | ) |
Definition at line 126 of file walletdb.cpp.
References nWalletDBUpdated.
Referenced by CWallet::IncOrderPosNext().
bool CWalletDB::WritePool | ( | int64_t | nPool, |
const CKeyPool & | keypool | ||
) |
Definition at line 143 of file walletdb.cpp.
References nWalletDBUpdated.
Referenced by CWallet::AddReserveKey(), CWallet::NewKeyPool(), and CWallet::TopUpKeyPool().
bool CWalletDB::WritePurpose | ( | const std::string & | strAddress, |
const std::string & | purpose | ||
) |
Definition at line 41 of file walletdb.cpp.
References nWalletDBUpdated.
Referenced by CWallet::SetAddressBook().
Definition at line 53 of file walletdb.cpp.
References nWalletDBUpdated.
Referenced by CWalletTx::WriteToDisk().
Definition at line 746 of file walletdb.cpp.
References DB_CORRUPT, and DB_LOAD_OK.
Referenced by CWallet::ZapWalletTx().