Fabcoin Core
0.16.2
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) | |
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 | WriteToken (const CTokenInfo &wtoken) |
bool | EraseToken (uint256 hash) |
bool | WriteTokenTx (const CTokenTx &wTokenTx) |
bool | EraseTokenTx (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 | 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 | 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... | |
bool | WriteContractData (const std::string &address, const std::string &key, const std::string &value) |
Write contract data key,value tuple to database. More... | |
bool | EraseContractData (const std::string &address, const std::string &key) |
Erase contract 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) |
CWalletDB (const CWalletDB &) | |
void | operator= (const CWalletDB &) |
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 143 of file walletdb.h.
|
inline |
|
private |
bool CWalletDB::EraseContractData | ( | const std::string & | address, |
const std::string & | key | ||
) |
Erase contract data tuple from wallet database.
Definition at line 931 of file walletdb.cpp.
bool CWalletDB::EraseDestData | ( | const std::string & | address, |
const std::string & | key | ||
) |
Erase destination data tuple from wallet database.
Definition at line 871 of file walletdb.cpp.
|
inlineprivate |
bool CWalletDB::EraseName | ( | const std::string & | strAddress | ) |
Definition at line 32 of file walletdb.cpp.
bool CWalletDB::ErasePool | ( | int64_t | nPool | ) |
Definition at line 148 of file walletdb.cpp.
bool CWalletDB::ErasePurpose | ( | const std::string & | strAddress | ) |
Definition at line 44 of file walletdb.cpp.
bool CWalletDB::EraseToken | ( | uint256 | hash | ) |
Definition at line 912 of file walletdb.cpp.
bool CWalletDB::EraseTokenTx | ( | uint256 | hash | ) |
bool CWalletDB::EraseTx | ( | uint256 | hash | ) |
Definition at line 54 of file walletdb.cpp.
bool CWalletDB::EraseWatchOnly | ( | const CScript & | script | ) |
Definition at line 108 of file walletdb.cpp.
DBErrors CWalletDB::FindWalletTx | ( | std::vector< uint256 > & | vTxHash, |
std::vector< CWalletTx > & | vWtx | ||
) |
Definition at line 670 of file walletdb.cpp.
CAmount CWalletDB::GetAccountCreditDebit | ( | const std::string & | strAccount | ) |
Definition at line 174 of file walletdb.cpp.
|
static |
void CWalletDB::ListAccountCreditDebit | ( | const std::string & | strAccount, |
std::list< CAccountingEntry > & | acentries | ||
) |
Definition at line 186 of file walletdb.cpp.
Definition at line 563 of file walletdb.cpp.
|
private |
bool CWalletDB::ReadAccount | ( | const std::string & | strAccount, |
CAccount & | account | ||
) |
Definition at line 158 of file walletdb.cpp.
bool CWalletDB::ReadBestBlock | ( | CBlockLocator & | locator | ) |
Definition at line 122 of file walletdb.cpp.
bool CWalletDB::ReadPool | ( | int64_t | nPool, |
CKeyPool & | keypool | ||
) |
Definition at line 138 of file walletdb.cpp.
bool CWalletDB::ReadVersion | ( | int & | nVersion | ) |
Read wallet version.
Definition at line 897 of file walletdb.cpp.
|
static |
Definition at line 821 of file walletdb.cpp.
|
static |
|
static |
Definition at line 833 of file walletdb.cpp.
bool CWalletDB::TxnAbort | ( | ) |
Abort current transaction.
Definition at line 892 of file walletdb.cpp.
bool CWalletDB::TxnBegin | ( | ) |
Begin a new transaction.
Definition at line 882 of file walletdb.cpp.
bool CWalletDB::TxnCommit | ( | ) |
Commit current transaction.
Definition at line 887 of file walletdb.cpp.
|
static |
Definition at line 861 of file walletdb.cpp.
|
static |
Definition at line 856 of file walletdb.cpp.
bool CWalletDB::WriteAccount | ( | const std::string & | strAccount, |
const CAccount & | account | ||
) |
Definition at line 164 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 169 of file walletdb.cpp.
bool CWalletDB::WriteBestBlock | ( | const CBlockLocator & | locator | ) |
Definition at line 116 of file walletdb.cpp.
bool CWalletDB::WriteContractData | ( | const std::string & | address, |
const std::string & | key, | ||
const std::string & | value | ||
) |
Write contract data key,value tuple to database.
Definition at line 926 of file walletdb.cpp.
bool CWalletDB::WriteCryptedKey | ( | const CPubKey & | vchPubKey, |
const std::vector< unsigned char > & | vchCryptedSecret, | ||
const CKeyMetadata & | keyMeta | ||
) |
Definition at line 74 of file walletdb.cpp.
Definition at line 95 of file walletdb.cpp.
bool CWalletDB::WriteDefaultKey | ( | const CPubKey & | vchPubKey | ) |
Definition at line 133 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 866 of file walletdb.cpp.
bool CWalletDB::WriteHDChain | ( | const CHDChain & | chain | ) |
write the hdchain model (external chain child index counter)
Definition at line 877 of file walletdb.cpp.
|
inlineprivate |
bool CWalletDB::WriteKey | ( | const CPubKey & | vchPubKey, |
const CPrivKey & | vchPrivKey, | ||
const CKeyMetadata & | keyMeta | ||
) |
Definition at line 59 of file walletdb.cpp.
bool CWalletDB::WriteMasterKey | ( | unsigned int | nID, |
const CMasterKey & | kMasterKey | ||
) |
Definition at line 90 of file walletdb.cpp.
bool CWalletDB::WriteMinVersion | ( | int | nVersion | ) |
Definition at line 153 of file walletdb.cpp.
bool CWalletDB::WriteName | ( | const std::string & | strAddress, |
const std::string & | strName | ||
) |
Definition at line 27 of file walletdb.cpp.
bool CWalletDB::WriteOrderPosNext | ( | int64_t | nOrderPosNext | ) |
Definition at line 128 of file walletdb.cpp.
bool CWalletDB::WritePool | ( | int64_t | nPool, |
const CKeyPool & | keypool | ||
) |
Definition at line 143 of file walletdb.cpp.
bool CWalletDB::WritePurpose | ( | const std::string & | strAddress, |
const std::string & | purpose | ||
) |
Definition at line 39 of file walletdb.cpp.
bool CWalletDB::WriteToken | ( | const CTokenInfo & | wtoken | ) |
Definition at line 907 of file walletdb.cpp.
bool CWalletDB::WriteTokenTx | ( | const CTokenTx & | wTokenTx | ) |
Definition at line 917 of file walletdb.cpp.
bool CWalletDB::WriteTx | ( | const CWalletTx & | wtx | ) |
Definition at line 49 of file walletdb.cpp.
bool CWalletDB::WriteVersion | ( | int | nVersion | ) |
Write wallet version.
Definition at line 902 of file walletdb.cpp.
bool CWalletDB::WriteWatchOnly | ( | const CScript & | script, |
const CKeyMetadata & | keymeta | ||
) |
Definition at line 100 of file walletdb.cpp.
DBErrors CWalletDB::ZapSelectTx | ( | std::vector< uint256 > & | vHashIn, |
std::vector< uint256 > & | vHashOut | ||
) |
Definition at line 733 of file walletdb.cpp.
Definition at line 771 of file walletdb.cpp.
|
private |
Definition at line 261 of file walletdb.h.
|
private |
Definition at line 262 of file walletdb.h.