PRCYCoin  2.0.0.7rc1
P2P Digital Currency
Public Member Functions | Static Public Member Functions | Private Member Functions | List of all members
CWalletDB Class Reference

Access to the wallet database (wallet.dat) More...

#include <walletdb.h>

Inheritance diagram for CWalletDB:
[legend]
Collaboration diagram for CWalletDB:
[legend]

Public Member Functions

 CWalletDB (const std::string &strFilename, 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 (uint256 hash, const CWalletTx &wtx)
 
bool EraseTx (uint256 hash)
 
bool WriteStakingStatus (bool status)
 
bool ReadStakingStatus ()
 
bool Write2FA (bool status)
 
bool Read2FA ()
 
bool Write2FASecret (std::string secret)
 
std::string Read2FASecret ()
 
bool Write2FAPeriod (int period)
 
int Read2FAPeriod ()
 
bool Write2FALastTime (uint64_t lastTime)
 
uint64_t Read2FALastTime ()
 
bool WriteScannedBlockHeight (int height)
 
bool ReadScannedBlockHeight (int &height)
 
bool WriteReserveAmount (const double &amount)
 
bool ReadReserveAmount (double &amount)
 
bool WriteTxPrivateKey (const std::string &outpointKey, const std::string &k)
 
bool ReadTxPrivateKey (const std::string &outpointKey, std::string &k)
 
bool WriteKeyImage (const std::string &outpointKey, const CKeyImage &k)
 
bool ReadKeyImage (const std::string &outpointKey, CKeyImage &k)
 
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)
 
bool EraseWatchOnly (const CScript &script)
 
bool WriteMultiSig (const CScript &script)
 
bool EraseMultiSig (const CScript &script)
 
bool WriteBestBlock (const CBlockLocator &locator)
 
bool ReadBestBlock (CBlockLocator &locator)
 
bool WriteOrderPosNext (int64_t nOrderPosNext)
 
bool WriteStakeSplitThreshold (uint64_t nStakeSplitThreshold)
 
bool WriteMultiSend (std::vector< std::pair< std::string, int > > vMultiSend)
 
bool EraseMultiSend (std::vector< std::pair< std::string, int > > vMultiSend)
 
bool WriteMSettings (bool fMultiSendStake, bool fMultiSendMasternode, int nLastMultiSendHeight)
 
bool WriteMSDisabledAddresses (std::vector< std::string > vDisabledAddresses)
 
bool EraseMSDisabledAddresses (std::vector< std::string > vDisabledAddresses)
 
bool WriteAutoCombineSettings (bool fEnable, CAmount nCombineThreshold)
 
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_Backend (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 WriteAutoConsolidateSettingTime (uint32_t settingTime)
 
uint32_t ReadAutoConsolidateSettingTime ()
 
bool ReadStealthAccount (const std::string &strAccount, CStealthAccount &account)
 
bool WriteStealthAccount (const std::string &strAccount, const CStealthAccount &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 WriteHDChain (const CHDChain &chain)
 
bool WriteCryptedHDChain (const CHDChain &chain)
 
bool WriteHDPubKey (const CHDPubKey &hdPubKey, const CKeyMetadata &keyMeta)
 
CAmount GetAccountCreditDebit (const std::string &strAccount)
 
void ListAccountCreditDebit (const std::string &strAccount, std::list< CAccountingEntry > &acentries)
 
DBErrors ReorderTransactions (CWallet *pwallet)
 
DBErrors LoadWallet (CWallet *pwallet)
 
DBErrors FindWalletTx (CWallet *pwallet, std::vector< uint256 > &vTxHash, std::vector< CWalletTx > &vWtx)
 
DBErrors ZapWalletTx (CWallet *pwallet, std::vector< CWalletTx > &vWtx)
 
bool AppendStealthAccountList (const std::string &accountName)
 
bool ReadStealthAccountList (std::string &accountList)
 
- Public Member Functions inherited from CDB
void Flush ()
 
void Close ()
 
bool TxnBegin ()
 
bool TxnCommit ()
 
bool TxnAbort ()
 
bool ReadVersion (int &nVersion)
 
bool WriteVersion (int nVersion)
 

Static Public Member Functions

static bool Compact (CDBEnv &dbenv, const std::string &strFile)
 
static bool Recover (CDBEnv &dbenv, std::string filename, bool fOnlyKeys)
 
static bool Recover (CDBEnv &dbenv, std::string filename)
 
static void IncrementUpdateCounter ()
 
static unsigned int GetUpdateCounter ()
 
- Static Public Member Functions inherited from CDB
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

- Protected Member Functions inherited from CDB
 CDB (const std::string &strFilename, const char *pszMode="r+", bool fFlushOnCloseIn=true)
 
 ~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)
 
- Protected Attributes inherited from CDB
Db * pdb
 
std::string strFile
 
DbTxn * activeTxn
 
bool fReadOnly
 
bool fFlushOnClose
 

Detailed Description

Access to the wallet database (wallet.dat)

Definition at line 80 of file walletdb.h.

Constructor & Destructor Documentation

◆ CWalletDB() [1/2]

CWalletDB::CWalletDB ( const std::string &  strFilename,
const char *  pszMode = "r+",
bool  fFlushOnClose = true 
)
inline

Definition at line 83 of file walletdb.h.

◆ CWalletDB() [2/2]

CWalletDB::CWalletDB ( const CWalletDB )
private

Member Function Documentation

◆ AppendStealthAccountList()

bool CWalletDB::AppendStealthAccountList ( const std::string &  accountName)

Definition at line 33 of file walletdb.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Compact()

bool CWalletDB::Compact ( CDBEnv dbenv,
const std::string &  strFile 
)
static

Definition at line 1180 of file walletdb.cpp.

Here is the call graph for this function:

◆ EraseDestData()

bool CWalletDB::EraseDestData ( const std::string &  address,
const std::string &  key 
)

Erase destination data tuple from wallet database.

Definition at line 1291 of file walletdb.cpp.

Here is the caller graph for this function:

◆ EraseMSDisabledAddresses()

bool CWalletDB::EraseMSDisabledAddresses ( std::vector< std::string >  vDisabledAddresses)

Definition at line 245 of file walletdb.cpp.

◆ EraseMultiSend()

bool CWalletDB::EraseMultiSend ( std::vector< std::pair< std::string, int > >  vMultiSend)

Definition at line 212 of file walletdb.cpp.

Here is the caller graph for this function:

◆ EraseMultiSig()

bool CWalletDB::EraseMultiSig ( const CScript script)

Definition at line 155 of file walletdb.cpp.

◆ EraseName()

bool CWalletDB::EraseName ( const std::string &  strAddress)

Definition at line 56 of file walletdb.cpp.

Here is the caller graph for this function:

◆ ErasePool()

bool CWalletDB::ErasePool ( int64_t  nPool)

Definition at line 281 of file walletdb.cpp.

Here is the caller graph for this function:

◆ ErasePurpose()

bool CWalletDB::ErasePurpose ( const std::string &  strAddress)

Definition at line 70 of file walletdb.cpp.

Here is the caller graph for this function:

◆ EraseTx()

bool CWalletDB::EraseTx ( uint256  hash)

Definition at line 82 of file walletdb.cpp.

Here is the caller graph for this function:

◆ EraseWatchOnly()

bool CWalletDB::EraseWatchOnly ( const CScript script)

Definition at line 143 of file walletdb.cpp.

◆ FindWalletTx()

DBErrors CWalletDB::FindWalletTx ( CWallet pwallet,
std::vector< uint256 > &  vTxHash,
std::vector< CWalletTx > &  vWtx 
)

Definition at line 907 of file walletdb.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetAccountCreditDebit()

CAmount CWalletDB::GetAccountCreditDebit ( const std::string &  strAccount)

Definition at line 413 of file walletdb.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetUpdateCounter()

unsigned int CWalletDB::GetUpdateCounter ( )
static

Definition at line 1331 of file walletdb.cpp.

Here is the caller graph for this function:

◆ IncrementUpdateCounter()

void CWalletDB::IncrementUpdateCounter ( )
static

Definition at line 1326 of file walletdb.cpp.

◆ ListAccountCreditDebit()

void CWalletDB::ListAccountCreditDebit ( const std::string &  strAccount,
std::list< CAccountingEntry > &  acentries 
)

Definition at line 425 of file walletdb.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ LoadWallet()

DBErrors CWalletDB::LoadWallet ( CWallet pwallet)

Definition at line 811 of file walletdb.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=()

void CWalletDB::operator= ( const CWalletDB )
private

◆ Read2FA()

bool CWalletDB::Read2FA ( )

Definition at line 317 of file walletdb.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Read2FALastTime()

uint64_t CWalletDB::Read2FALastTime ( )

Definition at line 354 of file walletdb.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Read2FAPeriod()

int CWalletDB::Read2FAPeriod ( )

Definition at line 342 of file walletdb.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Read2FASecret()

std::string CWalletDB::Read2FASecret ( )

Definition at line 330 of file walletdb.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReadAccount()

bool CWalletDB::ReadAccount ( const std::string &  strAccount,
CAccount account 
)

Definition at line 362 of file walletdb.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReadAutoConsolidateSettingTime()

uint32_t CWalletDB::ReadAutoConsolidateSettingTime ( )

Definition at line 373 of file walletdb.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReadBestBlock()

bool CWalletDB::ReadBestBlock ( CBlockLocator locator)

Definition at line 179 of file walletdb.cpp.

Here is the call graph for this function:

◆ ReadKeyImage()

bool CWalletDB::ReadKeyImage ( const std::string &  outpointKey,
CKeyImage k 
)

Definition at line 1285 of file walletdb.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReadPool()

bool CWalletDB::ReadPool ( int64_t  nPool,
CKeyPool keypool 
)

Definition at line 270 of file walletdb.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReadReserveAmount()

bool CWalletDB::ReadReserveAmount ( double &  amount)

Definition at line 167 of file walletdb.cpp.

Here is the call graph for this function:

◆ ReadScannedBlockHeight()

bool CWalletDB::ReadScannedBlockHeight ( int &  height)

Definition at line 308 of file walletdb.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReadStakingStatus()

bool CWalletDB::ReadStakingStatus ( )

Definition at line 296 of file walletdb.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReadStealthAccount()

bool CWalletDB::ReadStealthAccount ( const std::string &  strAccount,
CStealthAccount account 
)

Definition at line 388 of file walletdb.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReadStealthAccountList()

bool CWalletDB::ReadStealthAccountList ( std::string &  accountList)

Definition at line 46 of file walletdb.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReadTxPrivateKey()

bool CWalletDB::ReadTxPrivateKey ( const std::string &  outpointKey,
std::string &  k 
)

Definition at line 1276 of file walletdb.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Recover() [1/2]

bool CWalletDB::Recover ( CDBEnv dbenv,
std::string  filename 
)
static

Definition at line 1260 of file walletdb.cpp.

Here is the call graph for this function:

◆ Recover() [2/2]

bool CWalletDB::Recover ( CDBEnv dbenv,
std::string  filename,
bool  fOnlyKeys 
)
static

Definition at line 1189 of file walletdb.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReorderTransactions()

DBErrors CWalletDB::ReorderTransactions ( CWallet pwallet)

Definition at line 466 of file walletdb.cpp.

Here is the call graph for this function:

◆ Write2FA()

bool CWalletDB::Write2FA ( bool  status)

Definition at line 313 of file walletdb.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Write2FALastTime()

bool CWalletDB::Write2FALastTime ( uint64_t  lastTime)

Definition at line 350 of file walletdb.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Write2FAPeriod()

bool CWalletDB::Write2FAPeriod ( int  period)

Definition at line 338 of file walletdb.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Write2FASecret()

bool CWalletDB::Write2FASecret ( std::string  secret)

Definition at line 326 of file walletdb.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ WriteAccount()

bool CWalletDB::WriteAccount ( const std::string &  strAccount,
const CAccount account 
)

Definition at line 383 of file walletdb.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ WriteAccountingEntry()

bool CWalletDB::WriteAccountingEntry ( const uint64_t  nAccEntryNum,
const CAccountingEntry acentry 
)
private

Definition at line 403 of file walletdb.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ WriteAccountingEntry_Backend()

bool CWalletDB::WriteAccountingEntry_Backend ( 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 408 of file walletdb.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ WriteAutoCombineSettings()

bool CWalletDB::WriteAutoCombineSettings ( bool  fEnable,
CAmount  nCombineThreshold 
)

Definition at line 255 of file walletdb.cpp.

Here is the caller graph for this function:

◆ WriteAutoConsolidateSettingTime()

bool CWalletDB::WriteAutoConsolidateSettingTime ( uint32_t  settingTime)

Definition at line 368 of file walletdb.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ WriteBestBlock()

bool CWalletDB::WriteBestBlock ( const CBlockLocator locator)

Definition at line 172 of file walletdb.cpp.

Here is the caller graph for this function:

◆ WriteCryptedHDChain()

bool CWalletDB::WriteCryptedHDChain ( const CHDChain chain)

Definition at line 1303 of file walletdb.cpp.

Here is the caller graph for this function:

◆ WriteCryptedKey()

bool CWalletDB::WriteCryptedKey ( const CPubKey vchPubKey,
const std::vector< unsigned char > &  vchCryptedSecret,
const CKeyMetadata keyMeta 
)

Definition at line 105 of file walletdb.cpp.

Here is the caller graph for this function:

◆ WriteCScript()

bool CWalletDB::WriteCScript ( const uint160 hash,
const CScript redeemScript 
)

Definition at line 131 of file walletdb.cpp.

Here is the caller graph for this function:

◆ WriteDefaultKey()

bool CWalletDB::WriteDefaultKey ( const CPubKey vchPubKey)

Definition at line 264 of file walletdb.cpp.

◆ WriteDestData()

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 1265 of file walletdb.cpp.

Here is the caller graph for this function:

◆ WriteHDChain()

bool CWalletDB::WriteHDChain ( const CHDChain chain)

Definition at line 1297 of file walletdb.cpp.

◆ WriteHDPubKey()

bool CWalletDB::WriteHDPubKey ( const CHDPubKey hdPubKey,
const CKeyMetadata keyMeta 
)

Definition at line 1316 of file walletdb.cpp.

Here is the caller graph for this function:

◆ WriteKey()

bool CWalletDB::WriteKey ( const CPubKey vchPubKey,
const CPrivKey vchPrivKey,
const CKeyMetadata keyMeta 
)

Definition at line 88 of file walletdb.cpp.

Here is the caller graph for this function:

◆ WriteKeyImage()

bool CWalletDB::WriteKeyImage ( const std::string &  outpointKey,
const CKeyImage k 
)

Definition at line 1281 of file walletdb.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ WriteMasterKey()

bool CWalletDB::WriteMasterKey ( unsigned int  nID,
const CMasterKey kMasterKey 
)

Definition at line 125 of file walletdb.cpp.

Here is the caller graph for this function:

◆ WriteMinVersion()

bool CWalletDB::WriteMinVersion ( int  nVersion)

Definition at line 287 of file walletdb.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ WriteMSDisabledAddresses()

bool CWalletDB::WriteMSDisabledAddresses ( std::vector< std::string >  vDisabledAddresses)

Definition at line 234 of file walletdb.cpp.

◆ WriteMSettings()

bool CWalletDB::WriteMSettings ( bool  fMultiSendStake,
bool  fMultiSendMasternode,
int  nLastMultiSendHeight 
)

Definition at line 225 of file walletdb.cpp.

Here is the caller graph for this function:

◆ WriteMultiSend()

bool CWalletDB::WriteMultiSend ( std::vector< std::pair< std::string, int > >  vMultiSend)

Definition at line 199 of file walletdb.cpp.

Here is the caller graph for this function:

◆ WriteMultiSig()

bool CWalletDB::WriteMultiSig ( const CScript script)

Definition at line 149 of file walletdb.cpp.

◆ WriteName()

bool CWalletDB::WriteName ( const std::string &  strAddress,
const std::string &  strName 
)

Definition at line 50 of file walletdb.cpp.

Here is the caller graph for this function:

◆ WriteOrderPosNext()

bool CWalletDB::WriteOrderPosNext ( int64_t  nOrderPosNext)

Definition at line 185 of file walletdb.cpp.

Here is the caller graph for this function:

◆ WritePool()

bool CWalletDB::WritePool ( int64_t  nPool,
const CKeyPool keypool 
)

Definition at line 275 of file walletdb.cpp.

Here is the caller graph for this function:

◆ WritePurpose()

bool CWalletDB::WritePurpose ( const std::string &  strAddress,
const std::string &  purpose 
)

Definition at line 64 of file walletdb.cpp.

◆ WriteReserveAmount()

bool CWalletDB::WriteReserveAmount ( const double &  amount)

Definition at line 161 of file walletdb.cpp.

Here is the caller graph for this function:

◆ WriteScannedBlockHeight()

bool CWalletDB::WriteScannedBlockHeight ( int  height)

Definition at line 304 of file walletdb.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ WriteStakeSplitThreshold()

bool CWalletDB::WriteStakeSplitThreshold ( uint64_t  nStakeSplitThreshold)

Definition at line 192 of file walletdb.cpp.

◆ WriteStakingStatus()

bool CWalletDB::WriteStakingStatus ( bool  status)

Definition at line 292 of file walletdb.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ WriteStealthAccount()

bool CWalletDB::WriteStealthAccount ( const std::string &  strAccount,
const CStealthAccount account 
)

Definition at line 396 of file walletdb.cpp.

Here is the call graph for this function:

◆ WriteTx()

bool CWalletDB::WriteTx ( uint256  hash,
const CWalletTx wtx 
)

Definition at line 76 of file walletdb.cpp.

Here is the caller graph for this function:

◆ WriteTxPrivateKey()

bool CWalletDB::WriteTxPrivateKey ( const std::string &  outpointKey,
const std::string &  k 
)

Definition at line 1271 of file walletdb.cpp.

Here is the call graph for this function:

◆ WriteWatchOnly()

bool CWalletDB::WriteWatchOnly ( const CScript script)

Definition at line 137 of file walletdb.cpp.

Here is the caller graph for this function:

◆ ZapWalletTx()

DBErrors CWalletDB::ZapWalletTx ( CWallet pwallet,
std::vector< CWalletTx > &  vWtx 
)

Definition at line 967 of file walletdb.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following files: