Raven Core
3.0.0
P2P Digital Currency
|
Access to the wallet database. More...
#include <walletdb.h>
Public Member Functions | |
CWalletDB (CWalletDBWrapper &dbw, const char *pszMode="r+", bool _fFlushOnClose=true) | |
CWalletDB (const CWalletDB &)=delete | |
CWalletDB & | operator= (const CWalletDB &)=delete |
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 (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 | WriteWatchOnly (const CScript &script, const CKeyMetadata &keymeta) |
bool | EraseWatchOnly (const CScript &script) |
bool | WriteBestBlock (const CBlockLocator &locator) |
bool | ReadBestBlock (CBlockLocator &locator) |
bool | WriteOrderPosNext (int64_t nOrderPosNext) |
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 | WriteAccountingEntry (const uint64_t nAccEntryNum, const CAccountingEntry &acentry) |
This writes directly to the database, and will not update the CWallet's cached accounting entries! Use wallet.AddAccountingEntry instead, to write and update its caches. More... | |
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... | |
CAmount | GetAccountCreditDebit (const std::string &strAccount) |
void | ListAccountCreditDebit (const std::string &strAccount, std::list< CAccountingEntry > &acentries) |
DBErrors | LoadWallet (CWallet *pwallet) |
DBErrors | FindWalletTx (std::vector< uint256 > &vTxHash, std::vector< CWalletTx > &vWtx) |
DBErrors | ZapWalletTx (std::vector< CWalletTx > &vWtx) |
DBErrors | ZapSelectTx (std::vector< uint256 > &vHashIn, std::vector< uint256 > &vHashOut) |
bool | WriteHDChain (const CHDChain &chain) |
write the hdchain model (external chain child index counter) More... | |
bool | TxnBegin () |
Begin a new transaction. More... | |
bool | TxnCommit () |
Commit current transaction. More... | |
bool | TxnAbort () |
Abort current transaction. More... | |
bool | ReadVersion (int &nVersion) |
Read wallet version. More... | |
bool | WriteVersion (int nVersion) |
Write wallet version. More... | |
Static Public Member Functions | |
static bool | Recover (const std::string &filename, void *callbackDataIn, bool(*recoverKVcallback)(void *callbackData, CDataStream ssKey, CDataStream ssValue), std::string &out_backup_filename) |
static bool | Recover (const std::string &filename, std::string &out_backup_filename) |
static bool | RecoverKeysOnlyFilter (void *callbackData, CDataStream ssKey, CDataStream ssValue) |
static bool | IsKeyType (const std::string &strType) |
static bool | VerifyEnvironment (const std::string &walletFile, const fs::path &dataDir, std::string &errorStr) |
static bool | VerifyDatabaseFile (const std::string &walletFile, const fs::path &dataDir, std::string &warningStr, std::string &errorStr) |
Private Member Functions | |
template<typename K , typename T > | |
bool | WriteIC (const K &key, const T &value, bool fOverwrite=true) |
template<typename K > | |
bool | EraseIC (const K &key) |
Private Attributes | |
CDB | batch |
CWalletDBWrapper & | m_dbw |
Access to the wallet database.
This should really be named CWalletDBBatch, as it represents a single transaction at the database. It will be committed when the object goes out of scope. Optionally (on by default) it will flush to disk as well.
Definition at line 142 of file walletdb.h.
|
inlineexplicit |
Definition at line 166 of file walletdb.h.
|
delete |
bool CWalletDB::EraseDestData | ( | const std::string & | address, |
const std::string & | key | ||
) |
Erase destination data tuple from wallet database.
Definition at line 840 of file walletdb.cpp.
|
inlineprivate |
bool CWalletDB::EraseName | ( | const std::string & | strAddress | ) |
bool CWalletDB::ErasePool | ( | int64_t | nPool | ) |
Definition at line 144 of file walletdb.cpp.
bool CWalletDB::ErasePurpose | ( | const std::string & | strAddress | ) |
bool CWalletDB::EraseTx | ( | uint256 | hash | ) |
Definition at line 55 of file walletdb.cpp.
bool CWalletDB::EraseWatchOnly | ( | const CScript & | script | ) |
DBErrors CWalletDB::FindWalletTx | ( | std::vector< uint256 > & | vTxHash, |
std::vector< CWalletTx > & | vWtx | ||
) |
Definition at line 639 of file walletdb.cpp.
CAmount CWalletDB::GetAccountCreditDebit | ( | const std::string & | strAccount | ) |
Definition at line 170 of file walletdb.cpp.
|
static |
void CWalletDB::ListAccountCreditDebit | ( | const std::string & | strAccount, |
std::list< CAccountingEntry > & | acentries | ||
) |
Definition at line 182 of file walletdb.cpp.
Definition at line 532 of file walletdb.cpp.
bool CWalletDB::ReadAccount | ( | const std::string & | strAccount, |
CAccount & | account | ||
) |
Definition at line 154 of file walletdb.cpp.
bool CWalletDB::ReadBestBlock | ( | CBlockLocator & | locator | ) |
bool CWalletDB::ReadPool | ( | int64_t | nPool, |
CKeyPool & | keypool | ||
) |
Definition at line 134 of file walletdb.cpp.
bool CWalletDB::ReadVersion | ( | int & | nVersion | ) |
Read wallet version.
Definition at line 866 of file walletdb.cpp.
|
static |
Definition at line 790 of file walletdb.cpp.
|
static |
|
static |
bool CWalletDB::TxnAbort | ( | ) |
Abort current transaction.
Definition at line 861 of file walletdb.cpp.
bool CWalletDB::TxnBegin | ( | ) |
Begin a new transaction.
Definition at line 851 of file walletdb.cpp.
bool CWalletDB::TxnCommit | ( | ) |
Commit current transaction.
Definition at line 856 of file walletdb.cpp.
|
static |
|
static |
bool CWalletDB::WriteAccount | ( | const std::string & | strAccount, |
const CAccount & | account | ||
) |
Definition at line 160 of file walletdb.cpp.
bool CWalletDB::WriteAccountingEntry | ( | const uint64_t | nAccEntryNum, |
const CAccountingEntry & | acentry | ||
) |
This writes directly to the database, and will not update the CWallet's cached accounting entries! Use wallet.AddAccountingEntry instead, to write and update its caches.
Definition at line 165 of file walletdb.cpp.
bool CWalletDB::WriteBestBlock | ( | const CBlockLocator & | locator | ) |
Definition at line 117 of file walletdb.cpp.
bool CWalletDB::WriteCryptedKey | ( | const CPubKey & | vchPubKey, |
const std::vector< unsigned char > & | vchCryptedSecret, | ||
const CKeyMetadata & | keyMeta | ||
) |
Definition at line 75 of file walletdb.cpp.
Definition at line 96 of file walletdb.cpp.
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 835 of file walletdb.cpp.
bool CWalletDB::WriteHDChain | ( | const CHDChain & | chain | ) |
write the hdchain model (external chain child index counter)
Definition at line 846 of file walletdb.cpp.
|
inlineprivate |
bool CWalletDB::WriteKey | ( | const CPubKey & | vchPubKey, |
const CPrivKey & | vchPrivKey, | ||
const CKeyMetadata & | keyMeta | ||
) |
Definition at line 60 of file walletdb.cpp.
bool CWalletDB::WriteMasterKey | ( | unsigned int | nID, |
const CMasterKey & | kMasterKey | ||
) |
Definition at line 91 of file walletdb.cpp.
bool CWalletDB::WriteMinVersion | ( | int | nVersion | ) |
Definition at line 149 of file walletdb.cpp.
bool CWalletDB::WriteName | ( | const std::string & | strAddress, |
const std::string & | strName | ||
) |
bool CWalletDB::WriteOrderPosNext | ( | int64_t | nOrderPosNext | ) |
Definition at line 129 of file walletdb.cpp.
bool CWalletDB::WritePool | ( | int64_t | nPool, |
const CKeyPool & | keypool | ||
) |
bool CWalletDB::WritePurpose | ( | const std::string & | strAddress, |
const std::string & | purpose | ||
) |
bool CWalletDB::WriteTx | ( | const CWalletTx & | wtx | ) |
Definition at line 50 of file walletdb.cpp.
bool CWalletDB::WriteVersion | ( | int | nVersion | ) |
Write wallet version.
Definition at line 871 of file walletdb.cpp.
bool CWalletDB::WriteWatchOnly | ( | const CScript & | script, |
const CKeyMetadata & | keymeta | ||
) |
DBErrors CWalletDB::ZapSelectTx | ( | std::vector< uint256 > & | vHashIn, |
std::vector< uint256 > & | vHashOut | ||
) |
Definition at line 702 of file walletdb.cpp.
Definition at line 740 of file walletdb.cpp.
|
private |
Definition at line 248 of file walletdb.h.
|
private |
Definition at line 249 of file walletdb.h.