![]() |
Master Core
v0.0.9 - 2abfd2849db8ba7a83957c64eb976b406713c123
|
A CWallet is an extension of a keystore, which also maintains a set of transactions and balances, and provides the ability to create new transactions. More...
#include <wallet.h>
Public Types | |
typedef std::map< unsigned int, CMasterKey > | MasterKeyMap |
typedef std::pair< CWalletTx *, CAccountingEntry * > | TxPair |
typedef std::multimap< int64_t, TxPair > | TxItems |
Public Member Functions | |
CWallet () | |
CWallet (std::string strWalletFileIn) | |
void | SetNull () |
const CWalletTx * | GetWalletTx (const uint256 &hash) const |
bool | CanSupportFeature (enum WalletFeature wf) |
void | AvailableCoins (std::vector< COutput > &vCoins, bool fOnlyConfirmed=true, const CCoinControl *coinControl=NULL) const |
bool | SelectCoinsMinConf (int64_t nTargetValue, int nConfMine, int nConfTheirs, std::vector< COutput > vCoins, std::set< std::pair< const CWalletTx *, unsigned int > > &setCoinsRet, int64_t &nValueRet) const |
bool | IsSpent (const uint256 &hash, unsigned int n) const |
bool | IsLockedCoin (uint256 hash, unsigned int n) const |
void | LockCoin (COutPoint &output) |
void | UnlockCoin (COutPoint &output) |
void | UnlockAllCoins () |
void | ListLockedCoins (std::vector< COutPoint > &vOutpts) |
CPubKey | GenerateNewKey () |
bool | AddKeyPubKey (const CKey &key, const CPubKey &pubkey) |
bool | LoadKey (const CKey &key, const CPubKey &pubkey) |
bool | LoadKeyMetadata (const CPubKey &pubkey, const CKeyMetadata &metadata) |
bool | LoadMinVersion (int nVersion) |
bool | AddCryptedKey (const CPubKey &vchPubKey, const std::vector< unsigned char > &vchCryptedSecret) |
bool | LoadCryptedKey (const CPubKey &vchPubKey, const std::vector< unsigned char > &vchCryptedSecret) |
bool | AddCScript (const CScript &redeemScript) |
bool | LoadCScript (const CScript &redeemScript) |
bool | AddDestData (const CTxDestination &dest, const std::string &key, const std::string &value) |
Adds a destination data tuple to the store, and saves it to disk. More... | |
bool | EraseDestData (const CTxDestination &dest, const std::string &key) |
Erases a destination data tuple in the store and on disk. More... | |
bool | LoadDestData (const CTxDestination &dest, const std::string &key, const std::string &value) |
Adds a destination data tuple to the store, without saving it to disk. More... | |
bool | GetDestData (const CTxDestination &dest, const std::string &key, std::string *value) const |
Look up a destination data tuple in the store, return true if found false otherwise. More... | |
bool | Unlock (const SecureString &strWalletPassphrase) |
bool | ChangeWalletPassphrase (const SecureString &strOldWalletPassphrase, const SecureString &strNewWalletPassphrase) |
bool | EncryptWallet (const SecureString &strWalletPassphrase) |
void | GetKeyBirthTimes (std::map< CKeyID, int64_t > &mapKeyBirth) const |
int64_t | IncOrderPosNext (CWalletDB *pwalletdb=NULL) |
Increment the next transaction order id. More... | |
TxItems | OrderedTxItems (std::list< CAccountingEntry > &acentries, std::string strAccount="") |
Get the wallet's activity log. More... | |
void | MarkDirty () |
bool | AddToWallet (const CWalletTx &wtxIn, bool fFromLoadWallet=false) |
void | SyncTransaction (const uint256 &hash, const CTransaction &tx, const CBlock *pblock) |
bool | AddToWalletIfInvolvingMe (const uint256 &hash, const CTransaction &tx, const CBlock *pblock, bool fUpdate) |
void | EraseFromWallet (const uint256 &hash) |
int | ScanForWalletTransactions (CBlockIndex *pindexStart, bool fUpdate=false) |
void | ReacceptWalletTransactions () |
void | ResendWalletTransactions () |
int64_t | GetBalance () const |
int64_t | GetUnconfirmedBalance () const |
int64_t | GetImmatureBalance () const |
bool | CreateTransaction (const std::vector< std::pair< CScript, int64_t > > &vecSend, CWalletTx &wtxNew, CReserveKey &reservekey, int64_t &nFeeRet, std::string &strFailReason, const CCoinControl *coinControl=NULL) |
bool | CreateTransaction (CScript scriptPubKey, int64_t nValue, CWalletTx &wtxNew, CReserveKey &reservekey, int64_t &nFeeRet, std::string &strFailReason, const CCoinControl *coinControl=NULL) |
bool | CommitTransaction (CWalletTx &wtxNew, CReserveKey &reservekey) |
std::string | SendMoney (CScript scriptPubKey, int64_t nValue, CWalletTx &wtxNew) |
std::string | SendMoneyToDestination (const CTxDestination &address, int64_t nValue, CWalletTx &wtxNew) |
bool | NewKeyPool () |
bool | TopUpKeyPool (unsigned int kpSize=0) |
int64_t | AddReserveKey (const CKeyPool &keypool) |
void | ReserveKeyFromKeyPool (int64_t &nIndex, CKeyPool &keypool) |
void | KeepKey (int64_t nIndex) |
void | ReturnKey (int64_t nIndex) |
bool | GetKeyFromPool (CPubKey &key) |
int64_t | GetOldestKeyPoolTime () |
void | GetAllReserveKeys (std::set< CKeyID > &setAddress) const |
std::set< std::set< CTxDestination > > | GetAddressGroupings () |
std::map< CTxDestination, int64_t > | GetAddressBalances () |
std::set< CTxDestination > | GetAccountAddresses (std::string strAccount) const |
bool | IsMine (const CTxIn &txin) const |
int64_t | GetDebit (const CTxIn &txin) const |
bool | IsMine (const CTxOut &txout) const |
int64_t | GetCredit (const CTxOut &txout) const |
bool | IsChange (const CTxOut &txout) const |
int64_t | GetChange (const CTxOut &txout) const |
bool | IsMine (const CTransaction &tx) const |
bool | IsFromMe (const CTransaction &tx) const |
int64_t | GetDebit (const CTransaction &tx) const |
int64_t | GetCredit (const CTransaction &tx) const |
int64_t | GetChange (const CTransaction &tx) const |
void | SetBestChain (const CBlockLocator &loc) |
DBErrors | LoadWallet (bool &fFirstRunRet) |
DBErrors | ZapWalletTx () |
bool | SetAddressBook (const CTxDestination &address, const std::string &strName, const std::string &purpose) |
bool | DelAddressBook (const CTxDestination &address) |
void | UpdatedTransaction (const uint256 &hashTx) |
void | Inventory (const uint256 &hash) |
unsigned int | GetKeyPoolSize () |
bool | SetDefaultKey (const CPubKey &vchPubKey) |
bool | SetMinVersion (enum WalletFeature, CWalletDB *pwalletdbIn=NULL, bool fExplicit=false) |
bool | SetMaxVersion (int nVersion) |
int | GetVersion () |
std::set< uint256 > | GetConflicts (const uint256 &txid) const |
![]() | |
CCryptoKeyStore () | |
bool | IsCrypted () const |
bool | IsLocked () const |
bool | Lock () |
bool | HaveKey (const CKeyID &address) const |
bool | GetKey (const CKeyID &address, CKey &keyOut) const |
bool | GetPubKey (const CKeyID &address, CPubKey &vchPubKeyOut) const |
void | GetKeys (std::set< CKeyID > &setAddress) const |
![]() | |
bool | HaveKey (const CKeyID &address) const |
void | GetKeys (std::set< CKeyID > &setAddress) const |
bool | GetKey (const CKeyID &address, CKey &keyOut) const |
virtual bool | HaveCScript (const CScriptID &hash) const |
virtual bool | GetCScript (const CScriptID &hash, CScript &redeemScriptOut) const |
![]() | |
virtual | ~CKeyStore () |
virtual bool | AddKey (const CKey &key) |
Public Attributes | |
CCriticalSection | cs_wallet |
Main wallet lock. More... | |
bool | fFileBacked |
std::string | strWalletFile |
std::set< int64_t > | setKeyPool |
std::map< CKeyID, CKeyMetadata > | mapKeyMetadata |
MasterKeyMap | mapMasterKeys |
unsigned int | nMasterKeyMaxID |
std::map< uint256, CWalletTx > | mapWallet |
int64_t | nOrderPosNext |
std::map< uint256, int > | mapRequestCount |
std::map< CTxDestination, CAddressBookData > | mapAddressBook |
CPubKey | vchDefaultKey |
std::set< COutPoint > | setLockedCoins |
int64_t | nTimeFirstKey |
boost::signals2::signal< void(CWallet *wallet, const CTxDestination &address, const std::string &label, bool isMine, const std::string &purpose, ChangeType status)> | NotifyAddressBookChanged |
Address book entry changed. More... | |
boost::signals2::signal< void(CWallet *wallet, const uint256 &hashTx, ChangeType status)> | NotifyTransactionChanged |
Wallet transaction added, removed or updated. More... | |
boost::signals2::signal< void(const std::string &title, int nProgress)> | ShowProgress |
Show progress e.g. More... | |
![]() | |
boost::signals2::signal< void(CCryptoKeyStore *wallet)> | NotifyStatusChanged |
Private Types | |
typedef std::multimap< COutPoint, uint256 > | TxSpends |
Private Member Functions | |
bool | SelectCoins (int64_t nTargetValue, std::set< std::pair< const CWalletTx *, unsigned int > > &setCoinsRet, int64_t &nValueRet, const CCoinControl *coinControl=NULL) const |
void | AddToSpends (const COutPoint &outpoint, const uint256 &wtxid) |
void | AddToSpends (const uint256 &wtxid) |
void | SyncMetaData (std::pair< TxSpends::iterator, TxSpends::iterator >) |
Private Attributes | |
CWalletDB * | pwalletdbEncryption |
int | nWalletVersion |
int | nWalletMaxVersion |
int64_t | nNextResend |
int64_t | nLastResend |
TxSpends | mapTxSpends |
Additional Inherited Members | |
![]() | |
bool | SetCrypted () |
bool | EncryptKeys (CKeyingMaterial &vMasterKeyIn) |
bool | Unlock (const CKeyingMaterial &vMasterKeyIn) |
![]() | |
friend | void::RegisterWallet (CWalletInterface *) |
friend | void::UnregisterWallet (CWalletInterface *) |
friend | void::UnregisterAllWallets () |
![]() | |
KeyMap | mapKeys |
ScriptMap | mapScripts |
![]() | |
CCriticalSection | cs_KeyStore |
A CWallet is an extension of a keystore, which also maintains a set of transactions and balances, and provides the ability to create new transactions.
typedef std::map<unsigned int, CMasterKey> CWallet::MasterKeyMap |
typedef std::multimap<int64_t, TxPair > CWallet::TxItems |
typedef std::pair<CWalletTx*, CAccountingEntry*> CWallet::TxPair |
|
private |
|
virtual |
Reimplemented from CCryptoKeyStore.
Definition at line 86 of file wallet.cpp.
References CCryptoKeyStore::AddCryptedKey(), CPubKey::GetID(), LOCK, strWalletFile, and CWalletDB::WriteCryptedKey().
|
virtual |
Reimplemented from CBasicKeyStore.
Definition at line 122 of file wallet.cpp.
References CBasicKeyStore::AddCScript(), Hash160(), strWalletFile, and CWalletDB::WriteCScript().
Referenced by addmultisigaddress().
bool CWallet::AddDestData | ( | const CTxDestination & | dest, |
const std::string & | key, | ||
const std::string & | value | ||
) |
Adds a destination data tuple to the store, and saves it to disk.
Definition at line 2059 of file wallet.cpp.
References strWalletFile, and CWalletDB::WriteDestData().
Referenced by WalletModel::saveReceiveRequest().
Reimplemented from CCryptoKeyStore.
Definition at line 71 of file wallet.cpp.
References CCryptoKeyStore::AddKeyPubKey(), AssertLockHeld, CPubKey::GetID(), CKey::GetPrivKey(), strWalletFile, and CWalletDB::WriteKey().
Referenced by importprivkey(), and importwallet().
int64_t CWallet::AddReserveKey | ( | const CKeyPool & | keypool | ) |
Definition at line 1690 of file wallet.cpp.
References cs_main, LOCK2, strWalletFile, and CWalletDB::WritePool().
Definition at line 335 of file wallet.cpp.
|
private |
Definition at line 345 of file wallet.cpp.
References CTxIn::prevout.
bool CWallet::AddToWallet | ( | const CWalletTx & | wtxIn, |
bool | fFromLoadWallet = false |
||
) |
Definition at line 483 of file wallet.cpp.
References CWalletTx::BindWallet(), CT_NEW, CT_UPDATED, CWalletTx::fFromMe, GetAdjustedTime(), GetArg(), CTransaction::GetHash(), base_uint< BITS >::GetHex(), CMerkleTx::hashBlock, LOCK, LogPrintf, mapBlockIndex, CMerkleTx::nIndex, CWalletTx::nOrderPos, NotifyTransactionChanged(), CAccountingEntry::nTime, CWalletTx::nTimeReceived, CWalletTx::nTimeSmart, runCommand(), base_uint< BITS >::ToString(), CMerkleTx::vMerkleBranch, and CWalletTx::WriteToDisk().
Referenced by ReadKeyValue().
bool CWallet::AddToWalletIfInvolvingMe | ( | const uint256 & | hash, |
const CTransaction & | tx, | ||
const CBlock * | pblock, | ||
bool | fUpdate | ||
) |
Definition at line 606 of file wallet.cpp.
References AssertLockHeld, and IsMine().
void CWallet::AvailableCoins | ( | std::vector< COutput > & | vCoins, |
bool | fOnlyConfirmed = true , |
||
const CCoinControl * | coinControl = NULL |
||
) | const |
Definition at line 1026 of file wallet.cpp.
References cs_main, CMerkleTx::GetBlocksToMaturity(), CMerkleTx::GetDepthInMainChain(), CCoinControl::HasSelected(), CTransaction::IsCoinBase(), IsFinalTx(), IsMine(), CCoinControl::IsSelected(), CWalletTx::IsTrusted(), LOCK2, and CTransaction::vout.
Referenced by WalletModel::getBalance(), and WalletModel::listCoins().
|
inline |
Definition at line 184 of file wallet.h.
References AssertLockHeld.
bool CWallet::ChangeWalletPassphrase | ( | const SecureString & | strOldWalletPassphrase, |
const SecureString & | strNewWalletPassphrase | ||
) |
Definition at line 167 of file wallet.cpp.
References CCrypter::Decrypt(), CCrypter::Encrypt(), GetTimeMillis(), LOCK, LogPrintf, CCrypter::SetKeyFromPassphrase(), strWalletFile, CCryptoKeyStore::Unlock(), and CWalletDB::WriteMasterKey().
Referenced by WalletModel::changePassphrase(), and walletpassphrasechange().
bool CWallet::CommitTransaction | ( | CWalletTx & | wtxNew, |
CReserveKey & | reservekey | ||
) |
Definition at line 1401 of file wallet.cpp.
References CMerkleTx::AcceptToMemoryPool(), CWalletTx::BindWallet(), cs_main, CT_UPDATED, CTransaction::GetHash(), COutPoint::hash, CReserveKey::KeepKey(), LOCK2, LogPrintf, NotifyTransactionChanged(), CTxIn::prevout, CWalletTx::RelayWalletTransaction(), strWalletFile, CTransaction::ToString(), and CTransaction::vin.
Referenced by mastercore::ClassB_send(), WalletModel::sendCoins(), and sendmany().
bool CWallet::CreateTransaction | ( | const std::vector< std::pair< CScript, int64_t > > & | vecSend, |
CWalletTx & | wtxNew, | ||
CReserveKey & | reservekey, | ||
int64_t & | nFeeRet, | ||
std::string & | strFailReason, | ||
const CCoinControl * | coinControl = NULL |
||
) |
Referenced by mastercore::ClassB_send(), WalletModel::prepareTransaction(), and sendmany().
bool CWallet::CreateTransaction | ( | CScript | scriptPubKey, |
int64_t | nValue, | ||
CWalletTx & | wtxNew, | ||
CReserveKey & | reservekey, | ||
int64_t & | nFeeRet, | ||
std::string & | strFailReason, | ||
const CCoinControl * | coinControl = NULL |
||
) |
Definition at line 1392 of file wallet.cpp.
bool CWallet::DelAddressBook | ( | const CTxDestination & | address | ) |
Definition at line 1568 of file wallet.cpp.
References CT_DELETED, CWalletDB::EraseDestData(), CWalletDB::EraseName(), CWalletDB::ErasePurpose(), IsMine(), LOCK, NotifyAddressBookChanged(), PAIRTYPE, strWalletFile, and CBase58Data::ToString().
Referenced by AddressTableModel::removeRows(), and AddressTableModel::setData().
bool CWallet::EncryptWallet | ( | const SecureString & | strWalletPassphrase | ) |
Definition at line 356 of file wallet.cpp.
References CCrypter::Encrypt(), FEATURE_WALLETCRYPT, GetTimeMillis(), LOCK, LogPrintf, CMasterKey::nDerivationMethod, CMasterKey::nDeriveIterations, RandAddSeedPerfmon(), CDB::Rewrite(), CCrypter::SetKeyFromPassphrase(), strWalletFile, CMasterKey::vchCryptedKey, CMasterKey::vchSalt, WALLET_CRYPTO_KEY_SIZE, and WALLET_CRYPTO_SALT_SIZE.
Referenced by encryptwallet(), and WalletModel::setWalletEncrypted().
bool CWallet::EraseDestData | ( | const CTxDestination & | dest, |
const std::string & | key | ||
) |
Erases a destination data tuple in the store and on disk.
Definition at line 2070 of file wallet.cpp.
References CWalletDB::EraseDestData(), and strWalletFile.
Referenced by WalletModel::saveReceiveRequest().
|
virtual |
Implements CWalletInterface.
Definition at line 640 of file wallet.cpp.
References CWalletDB::EraseTx(), LOCK, and strWalletFile.
CPubKey CWallet::GenerateNewKey | ( | ) |
Definition at line 45 of file wallet.cpp.
References AssertLockHeld, FEATURE_COMPRPUBKEY, CPubKey::GetID(), CKey::GetPubKey(), GetTime(), CKey::MakeNewKey(), and RandAddSeedPerfmon().
set< CTxDestination > CWallet::GetAccountAddresses | ( | std::string | strAccount | ) | const |
Definition at line 1889 of file wallet.cpp.
References AssertLockHeld, CAddressBookData::name, and PAIRTYPE.
Referenced by PaymentServer::fetchPaymentACK(), and getreceivedbyaccount().
std::map< CTxDestination, int64_t > CWallet::GetAddressBalances | ( | ) |
Definition at line 1756 of file wallet.cpp.
References ExtractDestination(), CMerkleTx::GetBlocksToMaturity(), CMerkleTx::GetDepthInMainChain(), CTransaction::IsCoinBase(), IsFinalTx(), CWalletTx::IsFromMe(), IsMine(), CWalletTx::IsTrusted(), LOCK, PAIRTYPE, and CTransaction::vout.
Referenced by listaddressgroupings().
set< set< CTxDestination > > CWallet::GetAddressGroupings | ( | ) |
Definition at line 1796 of file wallet.cpp.
References AssertLockHeld, ExtractDestination(), COutPoint::hash, IsMine(), COutPoint::n, PAIRTYPE, CTxIn::prevout, CTxOut::scriptPubKey, CTransaction::vin, and CTransaction::vout.
Referenced by listaddressgroupings().
void CWallet::GetAllReserveKeys | ( | std::set< CKeyID > & | setAddress | ) | const |
Definition at line 1940 of file wallet.cpp.
References cs_main, CPubKey::GetID(), CPubKey::IsValid(), LOCK2, CWalletDB::ReadPool(), strWalletFile, and CKeyPool::vchPubKey.
Referenced by dumpwallet().
int64_t CWallet::GetBalance | ( | ) | const |
Definition at line 980 of file wallet.cpp.
References cs_main, CWalletTx::GetAvailableCredit(), CWalletTx::IsTrusted(), and LOCK2.
Referenced by WalletModel::getBalance(), getbalance(), getinfo(), and getwalletinfo().
|
inline |
Definition at line 292 of file wallet.h.
References MoneyRange(), and CTxOut::nValue.
Referenced by CWalletTx::GetChange().
|
inline |
Definition at line 331 of file wallet.h.
References MoneyRange(), and CTransaction::vout.
Definition at line 258 of file wallet.cpp.
References AssertLockHeld, CTxIn::prevout, and CTransaction::vin.
|
inline |
Definition at line 285 of file wallet.h.
References IsMine(), MoneyRange(), and CTxOut::nValue.
Referenced by CWalletTx::GetAvailableCredit(), CWalletTx::GetCredit(), CWalletTx::GetImmatureCredit(), and TransactionDesc::toHTML().
|
inline |
Definition at line 320 of file wallet.h.
References MoneyRange(), and CTransaction::vout.
int64_t CWallet::GetDebit | ( | const CTxIn & | txin | ) | const |
Definition at line 669 of file wallet.cpp.
References COutPoint::hash, IsMine(), LOCK, COutPoint::n, CTxIn::prevout, and CTransaction::vout.
Referenced by CWalletTx::GetDebit(), and TransactionDesc::toHTML().
|
inline |
Definition at line 309 of file wallet.h.
References MoneyRange(), and CTransaction::vin.
bool CWallet::GetDestData | ( | const CTxDestination & | dest, |
const std::string & | key, | ||
std::string * | value | ||
) | const |
Look up a destination data tuple in the store, return true if found false otherwise.
Definition at line 2085 of file wallet.cpp.
int64_t CWallet::GetImmatureBalance | ( | ) | const |
Definition at line 1011 of file wallet.cpp.
References cs_main, CWalletTx::GetImmatureCredit(), and LOCK2.
Referenced by WalletModel::getImmatureBalance().
void CWallet::GetKeyBirthTimes | ( | std::map< CKeyID, int64_t > & | mapKeyBirth | ) | const |
Definition at line 2007 of file wallet.cpp.
References AssertLockHeld, chainActive, CChain::Contains(), ExtractAffectedKeys(), CMerkleTx::hashBlock, CChain::Height(), mapBlockIndex, CTxOut::scriptPubKey, and CTransaction::vout.
Referenced by dumpwallet().
bool CWallet::GetKeyFromPool | ( | CPubKey & | key | ) |
Definition at line 1726 of file wallet.cpp.
References LOCK, and CKeyPool::vchPubKey.
Referenced by AddressTableModel::addRow(), AppInit2(), PaymentServer::fetchPaymentACK(), GetAccountAddress(), and getnewaddress().
|
inline |
Definition at line 363 of file wallet.h.
References AssertLockHeld.
Referenced by getinfo(), getwalletinfo(), and keypoolrefill().
int64_t CWallet::GetOldestKeyPoolTime | ( | ) |
Definition at line 1745 of file wallet.cpp.
References GetTime(), and CKeyPool::nTime.
Referenced by getinfo(), and getwalletinfo().
int64_t CWallet::GetUnconfirmedBalance | ( | ) | const |
Definition at line 996 of file wallet.cpp.
References cs_main, CWalletTx::GetAvailableCredit(), CMerkleTx::GetDepthInMainChain(), IsFinalTx(), CWalletTx::IsTrusted(), and LOCK2.
Referenced by WalletModel::getUnconfirmedBalance(), and getunconfirmedbalance().
|
inline |
Definition at line 378 of file wallet.h.
References LOCK.
Referenced by getinfo(), and getwalletinfo().
Definition at line 36 of file wallet.cpp.
References LOCK.
Referenced by CWalletTx::IsTrusted().
int64_t CWallet::IncOrderPosNext | ( | CWalletDB * | pwalletdb = NULL | ) |
Increment the next transaction order id.
Definition at line 437 of file wallet.cpp.
References AssertLockHeld, strWalletFile, and CWalletDB::WriteOrderPosNext().
Referenced by movecmd().
|
inlinevirtual |
bool CWallet::IsChange | ( | const CTxOut & | txout | ) | const |
Definition at line 685 of file wallet.cpp.
References ExtractDestination(), IsMine(), LOCK, and CTxOut::scriptPubKey.
Referenced by WalletModel::listCoins().
|
inline |
Definition at line 1989 of file wallet.cpp.
References AssertLockHeld.
Referenced by WalletModel::isLockedCoin().
bool CWallet::IsMine | ( | const CTxIn & | txin | ) | const |
Definition at line 653 of file wallet.cpp.
References COutPoint::hash, IsMine(), LOCK, COutPoint::n, CTxIn::prevout, and CTransaction::vout.
Referenced by TransactionRecord::decomposeTransaction(), CWalletTx::IsTrusted(), WalletModel::listCoins(), and TransactionDesc::toHTML().
|
inline |
Definition at line 281 of file wallet.h.
References IsMine(), and CTxOut::scriptPubKey.
|
inline |
Definition at line 298 of file wallet.h.
References IsMine(), and CTransaction::vout.
Definition at line 319 of file wallet.cpp.
Referenced by CWalletTx::GetAvailableCredit(), WalletModel::isSpent(), and selectCoins().
void CWallet::KeepKey | ( | int64_t | nIndex | ) |
Definition at line 1705 of file wallet.cpp.
References CWalletDB::ErasePool(), LogPrintf, and strWalletFile.
void CWallet::ListLockedCoins | ( | std::vector< COutPoint > & | vOutpts | ) |
Definition at line 1997 of file wallet.cpp.
References AssertLockHeld.
Referenced by WalletModel::listCoins(), WalletModel::listLockedCoins(), and listlockunspent().
bool CWallet::LoadCryptedKey | ( | const CPubKey & | vchPubKey, |
const std::vector< unsigned char > & | vchCryptedSecret | ||
) |
Definition at line 117 of file wallet.cpp.
References CCryptoKeyStore::AddCryptedKey().
Referenced by ReadKeyValue().
bool CWallet::LoadCScript | ( | const CScript & | redeemScript | ) |
Definition at line 131 of file wallet.cpp.
References CBasicKeyStore::AddCScript(), CScript::GetID(), LogPrintf, and MAX_SCRIPT_ELEMENT_SIZE.
Referenced by ReadKeyValue().
bool CWallet::LoadDestData | ( | const CTxDestination & | dest, |
const std::string & | key, | ||
const std::string & | value | ||
) |
Adds a destination data tuple to the store, without saving it to disk.
Definition at line 2079 of file wallet.cpp.
Referenced by ReadKeyValue().
Definition at line 203 of file wallet.h.
References CCryptoKeyStore::AddKeyPubKey().
Referenced by ReadKeyValue().
bool CWallet::LoadKeyMetadata | ( | const CPubKey & | pubkey, |
const CKeyMetadata & | metadata | ||
) |
Definition at line 107 of file wallet.cpp.
References AssertLockHeld, CPubKey::GetID(), and CKeyMetadata::nCreateTime.
Referenced by ReadKeyValue().
|
inline |
Definition at line 207 of file wallet.h.
References AssertLockHeld.
Referenced by CWalletDB::FindWalletTx(), and CWalletDB::LoadWallet().
DBErrors CWallet::LoadWallet | ( | bool & | fFirstRunRet | ) |
Definition at line 1496 of file wallet.cpp.
References DB_LOAD_OK, DB_NEED_REWRITE, CClientUIInterface::LoadWallet, CWalletDB::LoadWallet(), LOCK, CDB::Rewrite(), strWalletFile, and uiInterface.
Referenced by AppInit2().
void CWallet::LockCoin | ( | COutPoint & | output | ) |
Definition at line 1971 of file wallet.cpp.
References AssertLockHeld.
Referenced by WalletModel::lockCoin(), and lockunspent().
void CWallet::MarkDirty | ( | ) |
Definition at line 474 of file wallet.cpp.
References LOCK, and PAIRTYPE.
Referenced by importprivkey(), and importwallet().
bool CWallet::NewKeyPool | ( | ) |
Definition at line 1608 of file wallet.cpp.
References CWalletDB::ErasePool(), GetArg(), LOCK, LogPrintf, strWalletFile, and CWalletDB::WritePool().
CWallet::TxItems CWallet::OrderedTxItems | ( | std::list< CAccountingEntry > & | acentries, |
std::string | strAccount = "" |
||
) |
Get the wallet's activity log.
Definition at line 449 of file wallet.cpp.
References AssertLockHeld, CWalletDB::ListAccountCreditDebit(), CWalletTx::nOrderPos, CAccountingEntry::nOrderPos, and strWalletFile.
Referenced by listtransactions(), and listtransactions_MP().
void CWallet::ReacceptWalletTransactions | ( | ) |
Definition at line 887 of file wallet.cpp.
References CMerkleTx::AcceptToMemoryPool(), CTxMemPool::cs, cs_main, CMerkleTx::GetDepthInMainChain(), CTransaction::GetHash(), CTransaction::IsCoinBase(), LOCK, LOCK2, mempool, and PAIRTYPE.
Referenced by AppInit2().
|
virtual |
Implements CWalletInterface.
Definition at line 931 of file wallet.cpp.
References GetRand(), GetTime(), LOCK, LogPrintf, nTimeBestReceived, CWalletTx::nTimeReceived, PAIRTYPE, and CWalletTx::RelayWalletTransaction().
void CWallet::ReserveKeyFromKeyPool | ( | int64_t & | nIndex, |
CKeyPool & | keypool | ||
) |
Definition at line 1663 of file wallet.cpp.
References CPubKey::GetID(), CPubKey::IsValid(), LOCK, LogPrintf, CWalletDB::ReadPool(), strWalletFile, and CKeyPool::vchPubKey.
void CWallet::ReturnKey | ( | int64_t | nIndex | ) |
Definition at line 1716 of file wallet.cpp.
int CWallet::ScanForWalletTransactions | ( | CBlockIndex * | pindexStart, |
bool | fUpdate = false |
||
) |
Definition at line 847 of file wallet.cpp.
References _(), chainActive, cs_main, CTransaction::GetHash(), GetTime(), Checkpoints::GuessVerificationProgress(), LOCK2, LogPrintf, CChain::Next(), CBlockIndex::nHeight, CBlockIndex::nTime, ReadBlockFromDisk(), ShowProgress(), CChain::Tip(), and CBlock::vtx.
Referenced by AppInit2(), importprivkey(), and importwallet().
|
private |
Definition at line 1204 of file wallet.cpp.
References bSpendZeroConfChange, CCoinControl::HasSelected(), COutput::i, COutput::tx, and CTransaction::vout.
bool CWallet::SelectCoinsMinConf | ( | int64_t | nTargetValue, |
int | nConfMine, | ||
int | nConfTheirs, | ||
std::vector< COutput > | vCoins, | ||
std::set< std::pair< const CWalletTx *, unsigned int > > & | setCoinsRet, | ||
int64_t & | nValueRet | ||
) | const |
Definition at line 1106 of file wallet.cpp.
References ApproximateBestSubset(), CENT, FormatMoney(), GetRandInt(), COutput::i, CWalletTx::IsFromMe(), LogPrint(), COutput::nDepth, COutput::tx, and CTransaction::vout.
Definition at line 1450 of file wallet.cpp.
References _(), FormatMoney(), LogPrintf, and strprintf.
string CWallet::SendMoneyToDestination | ( | const CTxDestination & | address, |
int64_t | nValue, | ||
CWalletTx & | wtxNew | ||
) |
Definition at line 1478 of file wallet.cpp.
References _(), nTransactionFee, and CScript::SetDestination().
Referenced by sendfrom(), and sendtoaddress().
bool CWallet::SetAddressBook | ( | const CTxDestination & | address, |
const std::string & | strName, | ||
const std::string & | purpose | ||
) |
Definition at line 1548 of file wallet.cpp.
References CT_NEW, CT_UPDATED, IsMine(), LOCK, NotifyAddressBookChanged(), strWalletFile, CWalletDB::WriteName(), and CWalletDB::WritePurpose().
Referenced by addmultisigaddress(), AddressTableModel::addRow(), AppInit2(), PaymentServer::fetchPaymentACK(), GetAccountAddress(), getnewaddress(), importprivkey(), importwallet(), WalletModel::sendCoins(), setaccount(), and AddressTableModel::setData().
|
virtual |
Implements CWalletInterface.
Definition at line 213 of file wallet.cpp.
References strWalletFile, and CWalletDB::WriteBestBlock().
Referenced by AppInit2(), and Shutdown().
bool CWallet::SetDefaultKey | ( | const CPubKey & | vchPubKey | ) |
Definition at line 1593 of file wallet.cpp.
References strWalletFile.
Referenced by AppInit2().
bool CWallet::SetMaxVersion | ( | int | nVersion | ) |
Definition at line 246 of file wallet.cpp.
References LOCK.
Referenced by AppInit2().
bool CWallet::SetMinVersion | ( | WalletFeature | nVersion, |
CWalletDB * | pwalletdbIn = NULL , |
||
bool | fExplicit = false |
||
) |
Definition at line 219 of file wallet.cpp.
References FEATURE_LATEST, LOCK, strWalletFile, and CWalletDB::WriteMinVersion().
Referenced by AppInit2().
|
inline |
Definition at line 155 of file wallet.h.
References FEATURE_BASE.
|
private |
Definition at line 281 of file wallet.cpp.
References CWalletTx::fFromMe, CWalletTx::mapValue, CWalletTx::nTimeSmart, CWalletTx::strFromAccount, and CWalletTx::vOrderForm.
|
virtual |
Implements CWalletInterface.
Definition at line 624 of file wallet.cpp.
References cs_main, COutPoint::hash, LOCK2, CTxIn::prevout, and CTransaction::vin.
bool CWallet::TopUpKeyPool | ( | unsigned int | kpSize = 0 | ) |
Definition at line 1632 of file wallet.cpp.
References GetArg(), LOCK, LogPrintf, strWalletFile, and CWalletDB::WritePool().
Referenced by getnewaddress(), getrawchangeaddress(), keypoolrefill(), and walletpassphrase().
bool CWallet::Unlock | ( | const SecureString & | strWalletPassphrase | ) |
Definition at line 147 of file wallet.cpp.
References CCrypter::Decrypt(), LOCK, CCrypter::SetKeyFromPassphrase(), and CCryptoKeyStore::Unlock().
Referenced by WalletModel::setWalletLocked(), and walletpassphrase().
void CWallet::UnlockAllCoins | ( | ) |
Definition at line 1983 of file wallet.cpp.
References AssertLockHeld.
Referenced by lockunspent().
void CWallet::UnlockCoin | ( | COutPoint & | output | ) |
Definition at line 1977 of file wallet.cpp.
References AssertLockHeld.
Referenced by lockunspent(), and WalletModel::unlockCoin().
|
virtual |
Implements CWalletInterface.
Definition at line 1960 of file wallet.cpp.
References CT_UPDATED, LOCK, and NotifyTransactionChanged().
DBErrors CWallet::ZapWalletTx | ( | ) |
Definition at line 1524 of file wallet.cpp.
References DB_LOAD_OK, DB_NEED_REWRITE, LOCK, CDB::Rewrite(), strWalletFile, and CWalletDB::ZapWalletTx().
Referenced by AppInit2().
|
mutable |
Main wallet lock.
This lock protects all the fields added by CWallet except for: fFileBacked (immutable after instantiation) strWalletFile (immutable after instantiation)
Definition at line 132 of file wallet.h.
Referenced by AddressTableModel::addRow(), WalletModel::changePassphrase(), mastercore::ClassB_send(), TransactionTablePriv::describe(), CRPCTable::execute(), PaymentServer::fetchPaymentACK(), CWalletDB::FindWalletTx(), getLabel(), WalletModel::getNumTransactions(), WalletModel::getOutputs(), importprivkey(), TransactionTablePriv::index(), WalletModel::isLockedCoin(), WalletModel::isSpent(), AddressTableModel::labelForAddress(), listaddressgroupings(), WalletModel::listCoins(), WalletModel::listLockedCoins(), listtransactions_MP(), WalletModel::loadReceiveRequests(), CWalletDB::LoadWallet(), WalletModel::lockCoin(), WalletModel::pollBalanceChanged(), WalletModel::prepareTransaction(), AddressTablePriv::refreshAddressTable(), msc_AddressTablePriv::refreshAddressTable(), TransactionTablePriv::refreshWallet(), AddressTableModel::removeRows(), CWalletDB::ReorderTransactions(), WalletModel::saveReceiveRequest(), selectCoins(), WalletModel::sendCoins(), AddressTableModel::setData(), TransactionDesc::toHTML(), WalletModel::unlockCoin(), and TransactionTablePriv::updateWallet().
bool CWallet::fFileBacked |
Definition at line 134 of file wallet.h.
Referenced by BackupWallet().
std::map<CTxDestination, CAddressBookData> CWallet::mapAddressBook |
Definition at line 173 of file wallet.h.
Referenced by AddressTableModel::addRow(), AppInit2(), dumpwallet(), getaccount(), getaddressesbyaccount(), getLabel(), AddressTableModel::labelForAddress(), listaccounts(), listaddressgroupings(), ListReceived(), ListTransactions(), WalletModel::loadReceiveRequests(), ReadKeyValue(), AddressTablePriv::refreshAddressTable(), msc_AddressTablePriv::refreshAddressTable(), WalletModel::sendCoins(), setaccount(), AddressTableModel::setData(), TransactionDesc::toHTML(), and validateaddress().
std::map<CKeyID, CKeyMetadata> CWallet::mapKeyMetadata |
Definition at line 138 of file wallet.h.
Referenced by importprivkey(), importwallet(), and ReadKeyValue().
MasterKeyMap CWallet::mapMasterKeys |
Definition at line 141 of file wallet.h.
Referenced by ReadKeyValue().
Definition at line 168 of file wallet.h.
Referenced by AppInit2(), TransactionTablePriv::describe(), GetAccountAddress(), GetAccountBalance(), getbalance(), WalletModel::getNumTransactions(), WalletModel::getOutputs(), getreceivedbyaccount(), getreceivedbyaddress(), gettransaction(), getwalletinfo(), TransactionTablePriv::index(), listaccounts(), WalletModel::listCoins(), ListReceived(), listsinceblock(), CWalletDB::LoadWallet(), TransactionTablePriv::refreshWallet(), CWalletDB::ReorderTransactions(), selectCoins(), and TransactionTablePriv::updateWallet().
unsigned int CWallet::nMasterKeyMaxID |
Definition at line 142 of file wallet.h.
Referenced by ReadKeyValue().
int64_t CWallet::nOrderPosNext |
Definition at line 170 of file wallet.h.
Referenced by ReadKeyValue(), and CWalletDB::ReorderTransactions().
boost::signals2::signal<void (CWallet *wallet, const CTxDestination &address, const std::string &label, bool isMine, const std::string &purpose, ChangeType status)> CWallet::NotifyAddressBookChanged |
Address book entry changed.
Definition at line 389 of file wallet.h.
Referenced by WalletModel::subscribeToCoreSignals(), and WalletModel::unsubscribeFromCoreSignals().
boost::signals2::signal<void (CWallet *wallet, const uint256 &hashTx, ChangeType status)> CWallet::NotifyTransactionChanged |
Wallet transaction added, removed or updated.
Definition at line 395 of file wallet.h.
Referenced by WalletModel::subscribeToCoreSignals(), and WalletModel::unsubscribeFromCoreSignals().
int64_t CWallet::nTimeFirstKey |
Definition at line 179 of file wallet.h.
Referenced by importprivkey(), importwallet(), CWalletDB::LoadWallet(), and ReadKeyValue().
std::set<int64_t> CWallet::setKeyPool |
Definition at line 137 of file wallet.h.
Referenced by AppInit2(), and ReadKeyValue().
boost::signals2::signal<void (const std::string &title, int nProgress)> CWallet::ShowProgress |
Show progress e.g.
for rescan
Definition at line 398 of file wallet.h.
Referenced by importwallet(), WalletModel::subscribeToCoreSignals(), SplashScreen::unsubscribeFromCoreSignals(), and WalletModel::unsubscribeFromCoreSignals().
std::string CWallet::strWalletFile |
Definition at line 135 of file wallet.h.
Referenced by AppInit2(), BackupWallet(), GetAccountAddress(), GetAccountBalance(), listaccounts(), and movecmd().
CPubKey CWallet::vchDefaultKey |
Definition at line 175 of file wallet.h.
Referenced by AppInit2(), CWalletDB::FindWalletTx(), CWalletDB::LoadWallet(), and ReadKeyValue().