![]() |
BSHA3
0.17.99
P2P Blockchain, based on Bitcoin
|
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 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 | 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... | |
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 | WriteWalletFlags (const uint64_t flags) |
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 fs::path &wallet_path, void *callbackDataIn, bool(*recoverKVcallback)(void *callbackData, CDataStream ssKey, CDataStream ssValue), std::string &out_backup_filename) |
static bool | Recover (const fs::path &wallet_path, 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 fs::path &wallet_path, std::string &errorStr) |
static bool | VerifyDatabaseFile (const fs::path &wallet_path, 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 | |
BerkeleyBatch | m_batch |
WalletDatabase & | m_database |
Access to the wallet database.
This 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 139 of file walletdb.h.
|
inlineexplicit |
Definition at line 163 of file walletdb.h.
|
delete |
bool WalletBatch::EraseDestData | ( | const std::string & | address, |
const std::string & | key | ||
) |
Erase destination data tuple from wallet database.
Definition at line 736 of file walletdb.cpp.
|
inlineprivate |
Definition at line 153 of file walletdb.h.
bool WalletBatch::EraseName | ( | const std::string & | strAddress | ) |
Definition at line 33 of file walletdb.cpp.
bool WalletBatch::ErasePool | ( | int64_t | nPool | ) |
Definition at line 144 of file walletdb.cpp.
bool WalletBatch::ErasePurpose | ( | const std::string & | strAddress | ) |
Definition at line 45 of file walletdb.cpp.
bool WalletBatch::EraseTx | ( | uint256 | hash | ) |
Definition at line 55 of file walletdb.cpp.
bool WalletBatch::EraseWatchOnly | ( | const CScript & | script | ) |
Definition at line 109 of file walletdb.cpp.
DBErrors WalletBatch::FindWalletTx | ( | std::vector< uint256 > & | vTxHash, |
std::vector< CWalletTx > & | vWtx | ||
) |
Definition at line 539 of file walletdb.cpp.
|
static |
Definition at line 431 of file walletdb.cpp.
Definition at line 437 of file walletdb.cpp.
|
delete |
bool WalletBatch::ReadBestBlock | ( | CBlockLocator & | locator | ) |
bool WalletBatch::ReadPool | ( | int64_t | nPool, |
CKeyPool & | keypool | ||
) |
Definition at line 134 of file walletdb.cpp.
bool WalletBatch::ReadVersion | ( | int & | nVersion | ) |
Read wallet version.
Definition at line 767 of file walletdb.cpp.
|
static |
Definition at line 686 of file walletdb.cpp.
|
static |
|
static |
bool WalletBatch::TxnAbort | ( | ) |
Abort current transaction.
Definition at line 762 of file walletdb.cpp.
bool WalletBatch::TxnBegin | ( | ) |
Begin a new transaction.
Definition at line 752 of file walletdb.cpp.
bool WalletBatch::TxnCommit | ( | ) |
Commit current transaction.
Definition at line 757 of file walletdb.cpp.
|
static |
Definition at line 726 of file walletdb.cpp.
|
static |
Definition at line 721 of file walletdb.cpp.
bool WalletBatch::WriteBestBlock | ( | const CBlockLocator & | locator | ) |
Definition at line 117 of file walletdb.cpp.
bool WalletBatch::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 WalletBatch::WriteDestData | ( | const std::string & | address, |
const std::string & | key, | ||
const std::string & | value | ||
) |
Write destination data key,value tuple to database.
Definition at line 731 of file walletdb.cpp.
bool WalletBatch::WriteHDChain | ( | const CHDChain & | chain | ) |
write the hdchain model (external chain child index counter)
Definition at line 742 of file walletdb.cpp.
|
inlineprivate |
Definition at line 143 of file walletdb.h.
bool WalletBatch::WriteKey | ( | const CPubKey & | vchPubKey, |
const CPrivKey & | vchPrivKey, | ||
const CKeyMetadata & | keyMeta | ||
) |
Definition at line 60 of file walletdb.cpp.
bool WalletBatch::WriteMasterKey | ( | unsigned int | nID, |
const CMasterKey & | kMasterKey | ||
) |
Definition at line 91 of file walletdb.cpp.
bool WalletBatch::WriteMinVersion | ( | int | nVersion | ) |
Definition at line 149 of file walletdb.cpp.
bool WalletBatch::WriteName | ( | const std::string & | strAddress, |
const std::string & | strName | ||
) |
Definition at line 28 of file walletdb.cpp.
bool WalletBatch::WriteOrderPosNext | ( | int64_t | nOrderPosNext | ) |
Definition at line 129 of file walletdb.cpp.
bool WalletBatch::WritePool | ( | int64_t | nPool, |
const CKeyPool & | keypool | ||
) |
Definition at line 139 of file walletdb.cpp.
bool WalletBatch::WritePurpose | ( | const std::string & | strAddress, |
const std::string & | purpose | ||
) |
Definition at line 40 of file walletdb.cpp.
bool WalletBatch::WriteTx | ( | const CWalletTx & | wtx | ) |
Definition at line 50 of file walletdb.cpp.
bool WalletBatch::WriteVersion | ( | int | nVersion | ) |
Write wallet version.
Definition at line 772 of file walletdb.cpp.
bool WalletBatch::WriteWalletFlags | ( | const uint64_t | flags | ) |
Definition at line 747 of file walletdb.cpp.
bool WalletBatch::WriteWatchOnly | ( | const CScript & | script, |
const CKeyMetadata & | keymeta | ||
) |
Definition at line 101 of file walletdb.cpp.
DBErrors WalletBatch::ZapSelectTx | ( | std::vector< uint256 > & | vHashIn, |
std::vector< uint256 > & | vHashOut | ||
) |
Definition at line 598 of file walletdb.cpp.
Definition at line 636 of file walletdb.cpp.
|
private |
Definition at line 237 of file walletdb.h.
|
private |
Definition at line 238 of file walletdb.h.