![]() |
Bitcoin ABC
0.22.15
P2P Digital Currency
|
Access to the wallet database. More...
#include <walletdb.h>
Public Member Functions | |
WalletBatch (WalletDatabase &database, const char *pszMode="r+", bool _fFlushOnClose=true) | |
WalletBatch (const WalletBatch &)=delete | |
WalletBatch & | operator= (const WalletBatch &)=delete |
bool | WriteName (const CTxDestination &address, const std::string &strName) |
bool | EraseName (const CTxDestination &address) |
bool | WritePurpose (const CTxDestination &address, const std::string &purpose) |
bool | ErasePurpose (const CTxDestination &address) |
bool | WriteTx (const CWalletTx &wtx) |
bool | EraseTx (uint256 hash) |
bool | WriteKeyMetadata (const CKeyMetadata &meta, const CPubKey &pubkey, const bool overwrite) |
bool | WriteKey (const CPubKey &vchPubKey, const CPrivKey &vchPrivKey, const CKeyMetadata &keyMeta) |
bool | WriteCryptedKey (const CPubKey &vchPubKey, const std::vector< uint8_t > &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 | WriteDescriptorKey (const uint256 &desc_id, const CPubKey &pubkey, const CPrivKey &privkey) |
bool | WriteCryptedDescriptorKey (const uint256 &desc_id, const CPubKey &pubkey, const std::vector< uint8_t > &secret) |
bool | WriteDescriptor (const uint256 &desc_id, const WalletDescriptor &descriptor) |
bool | WriteDescriptorDerivedCache (const CExtPubKey &xpub, const uint256 &desc_id, uint32_t key_exp_index, uint32_t der_index) |
bool | WriteDescriptorParentCache (const CExtPubKey &xpub, const uint256 &desc_id, uint32_t key_exp_index) |
bool | WriteDestData (const CTxDestination &address, const std::string &key, const std::string &value) |
Write destination data key,value tuple to database. More... | |
bool | EraseDestData (const CTxDestination &address, const std::string &key) |
Erase destination data tuple from wallet database. More... | |
bool | WriteActiveScriptPubKeyMan (uint8_t type, const uint256 &id, bool internal) |
DBErrors | LoadWallet (CWallet *pwallet) |
DBErrors | FindWalletTx (std::vector< TxId > &txIds, std::list< CWalletTx > &vWtx) |
DBErrors | ZapWalletTx (std::list< CWalletTx > &vWtx) |
DBErrors | ZapSelectTx (std::vector< TxId > &txIdsIn, std::vector< TxId > &txIdsOut) |
bool | WriteHDChain (const CHDChain &chain) |
write the hdchain model (external chain child index counter) More... | |
bool | WriteWalletFlags (const uint64_t flags) |
bool | TxnBegin () |
Begin a new transaction. More... | |
bool | TxnCommit () |
Commit current transaction. More... | |
bool | TxnAbort () |
Abort current transaction. More... | |
Static Public Member Functions | |
static bool | IsKeyType (const std::string &strType) |
static bool | VerifyEnvironment (const fs::path &wallet_path, bilingual_str &errorStr) |
static bool | VerifyDatabaseFile (const fs::path &wallet_path, bilingual_str &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 | |
BerkeleyBatch | m_batch |
WalletDatabase & | m_database |
Access to the wallet database.
Opens the database and provides read and write access to it. Each read and write is its own transaction. Multiple operation transactions can be started using TxnBegin() and committed using TxnCommit() Otherwise the transaction will be committed when the object goes out of scope. Optionally (on by default) it will flush to disk on close. Every 1000 writes will automatically trigger a flush to disk.
Definition at line 179 of file walletdb.h.
|
inlineexplicit |
|
delete |
bool WalletBatch::EraseDestData | ( | const CTxDestination & | address, |
const std::string & | key | ||
) |
Erase destination data tuple from wallet database.
Definition at line 1098 of file walletdb.cpp.
|
inlineprivate |
Definition at line 193 of file walletdb.h.
bool WalletBatch::EraseName | ( | const CTxDestination & | address | ) |
Definition at line 68 of file walletdb.cpp.
bool WalletBatch::ErasePool | ( | int64_t | nPool | ) |
bool WalletBatch::ErasePurpose | ( | const CTxDestination & | address | ) |
Definition at line 89 of file walletdb.cpp.
bool WalletBatch::EraseTx | ( | uint256 | hash | ) |
Definition at line 101 of file walletdb.cpp.
bool WalletBatch::EraseWatchOnly | ( | const CScript & | script | ) |
Definition at line 170 of file walletdb.cpp.
|
static |
Definition at line 763 of file walletdb.cpp.
|
delete |
bool WalletBatch::ReadBestBlock | ( | CBlockLocator & | locator | ) |
bool WalletBatch::ReadPool | ( | int64_t | nPool, |
CKeyPool & | keypool | ||
) |
bool WalletBatch::TxnAbort | ( | ) |
Abort current transaction.
Definition at line 1124 of file walletdb.cpp.
bool WalletBatch::TxnBegin | ( | ) |
Begin a new transaction.
Definition at line 1116 of file walletdb.cpp.
bool WalletBatch::TxnCommit | ( | ) |
Commit current transaction.
Definition at line 1120 of file walletdb.cpp.
|
static |
|
static |
bool WalletBatch::WriteActiveScriptPubKeyMan | ( | uint8_t | type, |
const uint256 & | id, | ||
bool | internal | ||
) |
bool WalletBatch::WriteBestBlock | ( | const CBlockLocator & | locator | ) |
bool WalletBatch::WriteCryptedKey | ( | const CPubKey & | vchPubKey, |
const std::vector< uint8_t > & | vchCryptedSecret, | ||
const CKeyMetadata & | keyMeta | ||
) |
bool WalletBatch::WriteDescriptor | ( | const uint256 & | desc_id, |
const WalletDescriptor & | descriptor | ||
) |
Definition at line 245 of file walletdb.cpp.
bool WalletBatch::WriteDescriptorDerivedCache | ( | const CExtPubKey & | xpub, |
const uint256 & | desc_id, | ||
uint32_t | key_exp_index, | ||
uint32_t | der_index | ||
) |
bool WalletBatch::WriteDescriptorKey | ( | const uint256 & | desc_id, |
const CPubKey & | pubkey, | ||
const CPrivKey & | privkey | ||
) |
Definition at line 218 of file walletdb.cpp.
bool WalletBatch::WriteDescriptorParentCache | ( | const CExtPubKey & | xpub, |
const uint256 & | desc_id, | ||
uint32_t | key_exp_index | ||
) |
bool WalletBatch::WriteDestData | ( | const CTxDestination & | address, |
const std::string & | key, | ||
const std::string & | value | ||
) |
Write destination data key,value tuple to database.
Definition at line 1085 of file walletdb.cpp.
bool WalletBatch::WriteHDChain | ( | const CHDChain & | chain | ) |
write the hdchain model (external chain child index counter)
Definition at line 1108 of file walletdb.cpp.
|
inlineprivate |
Definition at line 182 of file walletdb.h.
bool WalletBatch::WriteKey | ( | const CPubKey & | vchPubKey, |
const CPrivKey & | vchPrivKey, | ||
const CKeyMetadata & | keyMeta | ||
) |
Definition at line 111 of file walletdb.cpp.
bool WalletBatch::WriteKeyMetadata | ( | const CKeyMetadata & | meta, |
const CPubKey & | pubkey, | ||
const bool | overwrite | ||
) |
bool WalletBatch::WriteMasterKey | ( | unsigned int | nID, |
const CMasterKey & | kMasterKey | ||
) |
bool WalletBatch::WriteMinVersion | ( | int | nVersion | ) |
bool WalletBatch::WriteName | ( | const CTxDestination & | address, |
const std::string & | strName | ||
) |
Definition at line 58 of file walletdb.cpp.
bool WalletBatch::WriteOrderPosNext | ( | int64_t | nOrderPosNext | ) |
bool WalletBatch::WritePool | ( | int64_t | nPool, |
const CKeyPool & | keypool | ||
) |
bool WalletBatch::WritePurpose | ( | const CTxDestination & | address, |
const std::string & | purpose | ||
) |
Definition at line 79 of file walletdb.cpp.
bool WalletBatch::WriteTx | ( | const CWalletTx & | wtx | ) |
Definition at line 97 of file walletdb.cpp.
bool WalletBatch::WriteWalletFlags | ( | const uint64_t | flags | ) |
bool WalletBatch::WriteWatchOnly | ( | const CScript & | script, |
const CKeyMetadata & | keymeta | ||
) |
|
private |
Definition at line 297 of file walletdb.h.
|
private |
Definition at line 298 of file walletdb.h.