Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

MapWallet

Classes

struct  CompareValueOnly
 
class  CAffectedKeysVisitor
 

Functions

std::string COutput::ToString () const
 
int COutput::Priority () const
 
const CWalletTxCWallet::GetWalletTx (const uint256 &hash) const
 
CPubKey CWallet::GenerateNewKey (WalletBatch &batch, uint32_t nAccountIndex, bool fInternal)
 keystore implementation Generate a new key More...
 
void CWallet::DeriveNewChildKey (WalletBatch &batch, const CKeyMetadata &metadata, CKey &secretRet, uint32_t nAccountIndex, bool fInternal)
 
bool CWallet::GetPubKey (const CKeyID &address, CPubKey &vchPubKeyOut) const override
 GetPubKey implementation that also checks the mapHdPubKeys. More...
 
bool CWallet::GetKey (const CKeyID &address, CKey &keyOut) const override
 GetKey implementation that can derive a HD private key on the fly. More...
 
bool CWallet::HaveKey (const CKeyID &address) const override
 HaveKey implementation that also checks the mapHdPubKeys. More...
 
bool CWallet::LoadHDPubKey (const CHDPubKey &hdPubKey)
 loads a HDPubKey into the wallets memory More...
 
bool CWallet::AddHDPubKey (WalletBatch &batch, const CExtPubKey &extPubKey, bool fInternal)
 Adds a HDPubKey into the wallet(database) More...
 
bool CWallet::AddKeyPubKeyWithDB (WalletBatch &batch, const CKey &key, const CPubKey &pubkey)
 
bool CWallet::AddKeyPubKey (const CKey &key, const CPubKey &pubkey) override
 Adds a key to the store, and saves it to disk. More...
 
bool CWallet::AddCryptedKey (const CPubKey &vchPubKey, const std::vector< unsigned char > &vchCryptedSecret) override
 Adds an encrypted key to the store, and saves it to disk. More...
 
bool CWallet::LoadKeyMetadata (const CKeyID &keyID, const CKeyMetadata &metadata)
 Load metadata (used by LoadWallet) More...
 
bool CWallet::LoadScriptMetadata (const CScriptID &script_id, const CKeyMetadata &metadata)
 
bool CWallet::LoadCryptedKey (const CPubKey &vchPubKey, const std::vector< unsigned char > &vchCryptedSecret)
 Adds an encrypted key to the store, without saving it to disk (used by LoadWallet) More...
 
void CWallet::UpdateTimeFirstKey (int64_t nCreateTime)
 Update wallet first key creation time. More...
 
bool CWallet::AddCScript (const CScript &redeemScript) override
 Support for BIP 0013 : see https://github.com/bitcoin/bips/blob/master/bip-0013.mediawiki. More...
 
bool CWallet::LoadCScript (const CScript &redeemScript)
 
bool CWallet::AddWatchOnly (const CScript &dest) override
 Private version of AddWatchOnly method which does not accept a timestamp, and which will reset the wallet's nTimeFirstKey value to 1 if the watch key did not previously have a timestamp associated with it. More...
 
bool CWallet::AddWatchOnly (const CScript &dest, int64_t nCreateTime)
 Adds a watch-only address to the store, and saves it to disk. More...
 
bool CWallet::RemoveWatchOnly (const CScript &dest) override
 
bool CWallet::LoadWatchOnly (const CScript &dest)
 Adds a watch-only address to the store, without saving it to disk (used by LoadWallet) More...
 
bool CWallet::Unlock (const SecureString &strWalletPassphrase, bool fForMixingOnly=false)
 
bool CWallet::ChangeWalletPassphrase (const SecureString &strOldWalletPassphrase, const SecureString &strNewWalletPassphrase)
 
void CWallet::SetBestChain (const CBlockLocator &loc) override
 Notifies listeners of the new active block chain on-disk. More...
 
bool CWallet::SetMinVersion (enum WalletFeature, WalletBatch *batch_in=nullptr, bool fExplicit=false)
 signify that a particular wallet feature is now used. this may change nWalletVersion and nWalletMaxVersion if those are lower More...
 
bool CWallet::SetMaxVersion (int nVersion)
 change which version we're allowed to upgrade to (note that this does not immediately imply upgrading to that format) More...
 
std::set< uint256CWallet::GetConflicts (const uint256 &txid) const
 Get wallet transactions that conflict with given transaction (spend same outputs) More...
 
void CWallet::Flush (bool shutdown=false)
 Flush wallet (bitdb flush) More...
 
void CWallet::SyncMetaData (std::pair< TxSpends::iterator, TxSpends::iterator >)
 
bool CWallet::IsSpent (const uint256 &hash, unsigned int n) const
 Outpoint is spent if any non-conflicted transaction spends it: More...
 
void CWallet::AddToSpends (const COutPoint &outpoint, const uint256 &wtxid)
 
void CWallet::AddToSpends (const uint256 &wtxid)
 
bool CWallet::EncryptWallet (const SecureString &strWalletPassphrase)
 
DBErrors CWallet::ReorderTransactions ()
 
int64_t CWallet::IncOrderPosNext (WalletBatch *batch=nullptr)
 Increment the next transaction order id. More...
 
bool CWallet::AccountMove (std::string strFrom, std::string strTo, CAmount nAmount, std::string strComment="")
 
bool CWallet::GetAccountDestination (CTxDestination &dest, std::string strAccount, bool bForceNew=false)
 
void CWallet::MarkDirty ()
 
bool CWallet::AddToWallet (const CWalletTx &wtxIn, bool fFlushOnClose=true)
 
bool CWallet::LoadToWallet (const CWalletTx &wtxIn)
 
bool CWallet::AddToWalletIfInvolvingMe (const CTransactionRef &tx, const CBlockIndex *pIndex, int posInBlock, bool fUpdate)
 Add a transaction to the wallet, or update it. More...
 
bool CWallet::TransactionCanBeAbandoned (const uint256 &hashTx) const
 Return whether transaction can be abandoned. More...
 
bool CWallet::AbandonTransaction (const uint256 &hashTx)
 
void CWallet::MarkConflicted (const uint256 &hashBlock, const uint256 &hashTx)
 
void CWallet::SyncTransaction (const CTransactionRef &tx, const CBlockIndex *pindex=nullptr, int posInBlock=0)
 
void CWallet::TransactionAddedToMempool (const CTransactionRef &tx, int64_t nAcceptTime) override
 Notifies listeners of a transaction having been added to mempool. More...
 
void CWallet::TransactionRemovedFromMempool (const CTransactionRef &ptx) override
 Notifies listeners of a transaction leaving mempool. More...
 
void CWallet::BlockConnected (const std::shared_ptr< const CBlock > &pblock, const CBlockIndex *pindex, const std::vector< CTransactionRef > &vtxConflicted) override
 Notifies listeners of a block being connected. More...
 
void CWallet::BlockDisconnected (const std::shared_ptr< const CBlock > &pblock, const CBlockIndex *pindexDisconnected) override
 Notifies listeners of a block being disconnected. More...
 
void CWallet::BlockUntilSyncedToCurrentChain ()
 Blocks until the wallet state is up-to-date to /at least/ the current chain at the time this function is entered Obviously holding cs_main/cs_wallet when going into this call may cause deadlock. More...
 
isminetype CWallet::IsMine (const CTxIn &txin) const
 
CAmount CWallet::GetDebit (const CTxIn &txin, const isminefilter &filter) const
 Returns amount of debit if the input matches the filter, otherwise returns 0. More...
 
int CWallet::GetRealOutpointPrivateSendRounds (const COutPoint &outpoint, int nRounds=0) const
 
int CWallet::GetCappedOutpointPrivateSendRounds (const COutPoint &outpoint) const
 
bool CWallet::IsDenominated (const COutPoint &outpoint) const
 
bool CWallet::IsFullyMixed (const COutPoint &outpoint) const
 
isminetype CWallet::IsMine (const CTxOut &txout) const
 
CAmount CWallet::GetCredit (const CTxOut &txout, const isminefilter &filter) const
 
bool CWallet::IsChange (const CTxOut &txout) const
 
CAmount CWallet::GetChange (const CTxOut &txout) const
 
void CWallet::GenerateNewHDChain ()
 
bool CWallet::SetHDChain (WalletBatch &batch, const CHDChain &chain, bool memonly)
 
bool CWallet::SetCryptedHDChain (WalletBatch &batch, const CHDChain &chain, bool memonly)
 
bool CWallet::SetHDChainSingle (const CHDChain &chain, bool memonly)
 Set the HD chain model (chain child index counters) using temporary wallet db object which causes db flush every time these methods are used. More...
 
bool CWallet::SetCryptedHDChainSingle (const CHDChain &chain, bool memonly)
 
bool CWallet::GetDecryptedHDChain (CHDChain &hdChainRet)
 
bool CWallet::IsHDEnabled () const
 HD Wallet Functions. More...
 
bool CWallet::IsMine (const CTransaction &tx) const
 
bool CWallet::IsFromMe (const CTransaction &tx) const
 should probably be renamed to IsRelevantToMe More...
 
CAmount CWallet::GetDebit (const CTransaction &tx, const isminefilter &filter) const
 
bool CWallet::IsAllFromMe (const CTransaction &tx, const isminefilter &filter) const
 Returns whether all of the inputs match the filter. More...
 
CAmount CWallet::GetCredit (const CTransaction &tx, const isminefilter &filter) const
 
CAmount CWallet::GetChange (const CTransaction &tx) const
 
int64_t CWalletTx::GetTxTime () const
 
void CWalletTx::GetAmounts (std::list< COutputEntry > &listReceived, std::list< COutputEntry > &listSent, CAmount &nFee, std::string &strSentAccount, const isminefilter &filter) const
 
int64_t CWallet::RescanFromTime (int64_t startTime, const WalletRescanReserver &reserver, bool update)
 Scan active chain for relevant transactions after importing keys. More...
 
CBlockIndexCWallet::ScanForWalletTransactions (CBlockIndex *pindexStart, CBlockIndex *pindexStop, const WalletRescanReserver &reserver, bool fUpdate=false)
 Scan the block chain (starting in pindexStart) for transactions from or to us. More...
 
void CWallet::ReacceptWalletTransactions ()
 
bool CWalletTx::RelayWalletTransaction (CConnman *connman)
 
std::set< uint256CWalletTx::GetConflicts () const
 
CAmount CWalletTx::GetDebit (const isminefilter &filter) const
 filter decides which addresses will count towards the debit More...
 
CAmount CWalletTx::GetCredit (const isminefilter &filter) const
 
CAmount CWalletTx::GetImmatureCredit (bool fUseCache=true) const
 
CAmount CWalletTx::GetAvailableCredit (bool fUseCache=true) const
 
CAmount CWalletTx::GetImmatureWatchOnlyCredit (const bool fUseCache=true) const
 
CAmount CWalletTx::GetAvailableWatchOnlyCredit (const bool fUseCache=true) const
 
CAmount CWalletTx::GetAnonymizedCredit (const CCoinControl *coinControl=nullptr) const
 
CAmount CWalletTx::GetDenominatedCredit (bool unconfirmed, bool fUseCache=true) const
 
CAmount CWalletTx::GetChange () const
 
bool CWalletTx::InMempool () const
 
bool CWalletTx::IsTrusted () const
 
bool CWalletTx::IsEquivalentTo (const CWalletTx &tx) const
 
std::vector< uint256CWallet::ResendWalletTransactionsBefore (int64_t nTime, CConnman *connman)
 
void CWallet::ResendWalletTransactions (int64_t nBestBlockTime, CConnman *connman) override
 Tells listeners to broadcast their data. More...
 

Detailed Description

Function Documentation

◆ AbandonTransaction()

◆ AccountMove()

◆ AddCryptedKey()

bool CWallet::AddCryptedKey ( const CPubKey vchPubKey,
const std::vector< unsigned char > &  vchCryptedSecret 
)
overridevirtual

Adds an encrypted key to the store, and saves it to disk.

Reimplemented from CCryptoKeyStore.

Definition at line 412 of file wallet.cpp.

References CCryptoKeyStore::AddCryptedKey(), CWallet::cs_wallet, CWallet::encrypted_batch, CPubKey::GetID(), LOCK, CWallet::mapKeyMetadata, and WalletBatch::WriteCryptedKey().

◆ AddCScript()

bool CWallet::AddCScript ( const CScript redeemScript)
overridevirtual

◆ AddHDPubKey()

◆ AddKeyPubKey()

bool CWallet::AddKeyPubKey ( const CKey key,
const CPubKey pubkey 
)
overridevirtual

Adds a key to the store, and saves it to disk.

Reimplemented from CCryptoKeyStore.

Definition at line 405 of file wallet.cpp.

References CWallet::AddKeyPubKeyWithDB(), and CWallet::database.

Referenced by AddKey(), BOOST_FIXTURE_TEST_CASE(), importelectrumwallet(), importprivkey(), importwallet(), and ProcessImport().

◆ AddKeyPubKeyWithDB()

◆ AddToSpends() [1/2]

void CWallet::AddToSpends ( const COutPoint outpoint,
const uint256 wtxid 
)
private

◆ AddToSpends() [2/2]

void CWallet::AddToSpends ( const uint256 wtxid)
private

Definition at line 785 of file wallet.cpp.

References CWallet::AddToSpends(), CWallet::mapWallet, and CTxIn::prevout.

◆ AddToWallet()

◆ AddToWalletIfInvolvingMe()

bool CWallet::AddToWalletIfInvolvingMe ( const CTransactionRef ptx,
const CBlockIndex pIndex,
int  posInBlock,
bool  fUpdate 
)

Add a transaction to the wallet, or update it.

pIndex and posInBlock should be set when the transaction was known to be included in a block. When pIndex == nullptr, then wallet state is not updated in AddToWallet, but notifications happen and cached balances are marked dirty.

If fUpdate is true, existing transactions will be updated. TODO: One exception to this is that the abandoned state is cleared under the assumption that any further notification of a transaction that was considered abandoned is an indication that it is not safe to be considered abandoned. Abandoned state should probably be more carefully tracked via different posInBlock signals or by checking mempool presence when necessary.

Definition at line 1217 of file wallet.cpp.

References CWallet::AddToWallet(), AssertLockHeld(), CWallet::cs_wallet, CBlockIndex::GetBlockHash(), CTransaction::GetHash(), CWallet::IsFromMe(), CWallet::IsMine(), LogPrintf, CWallet::m_pool_key_to_index, CWallet::mapTxSpends, CWallet::mapWallet, CWallet::MarkConflicted(), CWallet::MarkReserveKeysAsUsed(), CTxIn::prevout, CAffectedKeysVisitor::Process(), CTxOut::scriptPubKey, CMerkleTx::SetMerkleBranch(), CWallet::TopUpKeyPool(), base_blob< BITS >::ToString(), CTransaction::vin, and CTransaction::vout.

Referenced by CWallet::ScanForWalletTransactions(), and CWallet::SyncTransaction().

◆ AddWatchOnly() [1/2]

bool CWallet::AddWatchOnly ( const CScript dest)
overrideprivatevirtual

Private version of AddWatchOnly method which does not accept a timestamp, and which will reset the wallet's nTimeFirstKey value to 1 if the watch key did not previously have a timestamp associated with it.

Because this is an inherited virtual method, it is accessible despite being marked private, but it is marked private anyway to encourage use of the other AddWatchOnly which accepts a timestamp and sets nTimeFirstKey more intelligently for more efficient rescans.

Reimplemented from CBasicKeyStore.

Definition at line 490 of file wallet.cpp.

References CBasicKeyStore::AddWatchOnly(), CWallet::m_script_metadata, CKeyMetadata::nCreateTime, CWallet::NotifyWatchonlyChanged, CWallet::UpdateTimeFirstKey(), and WalletBatch::WriteWatchOnly().

Referenced by CWallet::AddWatchOnly(), ImportScript(), and ProcessImport().

◆ AddWatchOnly() [2/2]

bool CWallet::AddWatchOnly ( const CScript dest,
int64_t  nCreateTime 
)

Adds a watch-only address to the store, and saves it to disk.

Definition at line 500 of file wallet.cpp.

References CWallet::AddWatchOnly(), and CWallet::m_script_metadata.

◆ BlockConnected()

void CWallet::BlockConnected ( const std::shared_ptr< const CBlock > &  block,
const CBlockIndex pindex,
const std::vector< CTransactionRef > &  txnConflicted 
)
overridevirtual

◆ BlockDisconnected()

void CWallet::BlockDisconnected ( const std::shared_ptr< const CBlock > &  block,
const CBlockIndex pindexDisconnected 
)
overridevirtual

Notifies listeners of a block being disconnected.

Called on a background thread.

Reimplemented from CValidationInterface.

Definition at line 1502 of file wallet.cpp.

References cs_main, CWallet::cs_wallet, CWallet::fAnonymizableTallyCached, CWallet::fAnonymizableTallyCachedNonDenom, LOCK2, and CWallet::SyncTransaction().

◆ BlockUntilSyncedToCurrentChain()

void CWallet::BlockUntilSyncedToCurrentChain ( )

◆ ChangeWalletPassphrase()

◆ DeriveNewChildKey()

◆ EncryptWallet()

◆ Flush()

void CWallet::Flush ( bool  shutdown = false)

Flush wallet (bitdb flush)

Definition at line 708 of file wallet.cpp.

References CWallet::database.

◆ GenerateNewHDChain()

◆ GenerateNewKey()

◆ GetAccountDestination()

◆ GetAmounts()

void CWalletTx::GetAmounts ( std::list< COutputEntry > &  listReceived,
std::list< COutputEntry > &  listSent,
CAmount nFee,
std::string &  strSentAccount,
const isminefilter filter 
) const

◆ GetAnonymizedCredit()

◆ GetAvailableCredit()

◆ GetAvailableWatchOnlyCredit()

◆ GetCappedOutpointPrivateSendRounds()

int CWallet::GetCappedOutpointPrivateSendRounds ( const COutPoint outpoint) const

◆ GetChange() [1/3]

◆ GetChange() [2/3]

CAmount CWallet::GetChange ( const CTxOut txout) const

Definition at line 1737 of file wallet.cpp.

References CWallet::IsChange(), MoneyRange(), and CTxOut::nValue.

Referenced by CWalletTx::GetChange(), and CWallet::GetChange().

◆ GetChange() [3/3]

CAmount CWallet::GetChange ( const CTransaction tx) const

Definition at line 1911 of file wallet.cpp.

References CWallet::GetChange(), MoneyRange(), and CTransaction::vout.

◆ GetConflicts() [1/2]

std::set< uint256 > CWalletTx::GetConflicts ( ) const

Definition at line 2157 of file wallet.cpp.

References CWallet::GetConflicts(), CMerkleTx::GetHash(), and CWalletTx::pwallet.

Referenced by WalletTxToJSON().

◆ GetConflicts() [2/2]

std::set< uint256 > CWallet::GetConflicts ( const uint256 txid) const

Get wallet transactions that conflict with given transaction (spend same outputs)

Definition at line 685 of file wallet.cpp.

References AssertLockHeld(), CWallet::cs_wallet, CWallet::mapTxSpends, CWallet::mapWallet, CTxIn::prevout, and CMerkleTx::tx.

Referenced by CWalletTx::GetConflicts().

◆ GetCredit() [1/3]

◆ GetCredit() [2/3]

◆ GetCredit() [3/3]

CAmount CWallet::GetCredit ( const CTransaction tx,
const isminefilter filter 
) const

Definition at line 1899 of file wallet.cpp.

References CWallet::GetCredit(), MoneyRange(), and CTransaction::vout.

◆ GetDebit() [1/3]

◆ GetDebit() [2/3]

CAmount CWallet::GetDebit ( const CTxIn txin,
const isminefilter filter 
) const

Returns amount of debit if the input matches the filter, otherwise returns 0.

Definition at line 1559 of file wallet.cpp.

References CWallet::cs_wallet, COutPoint::hash, CWallet::IsMine(), LOCK, CWallet::mapWallet, COutPoint::n, CTxIn::prevout, and CMerkleTx::tx.

Referenced by CWalletTx::GetDebit(), CWallet::GetDebit(), CWallet::IsFromMe(), and TransactionDesc::toHTML().

◆ GetDebit() [3/3]

CAmount CWallet::GetDebit ( const CTransaction tx,
const isminefilter filter 
) const

Definition at line 1866 of file wallet.cpp.

References CWallet::GetDebit(), MoneyRange(), and CTransaction::vin.

◆ GetDecryptedHDChain()

bool CWallet::GetDecryptedHDChain ( CHDChain hdChainRet)

◆ GetDenominatedCredit()

◆ GetImmatureCredit()

◆ GetImmatureWatchOnlyCredit()

◆ GetKey()

◆ GetPubKey()

bool CWallet::GetPubKey ( const CKeyID address,
CPubKey vchPubKeyOut 
) const
overridevirtual

GetPubKey implementation that also checks the mapHdPubKeys.

Reimplemented from CCryptoKeyStore.

Definition at line 286 of file wallet.cpp.

References CWallet::cs_wallet, CHDPubKey::extPubKey, CCryptoKeyStore::GetPubKey(), LOCK, CWallet::mapHdPubKeys, and CExtPubKey::pubkey.

Referenced by WalletModel::getPubKey().

◆ GetRealOutpointPrivateSendRounds()

◆ GetTxTime()

int64_t CWalletTx::GetTxTime ( ) const

◆ GetWalletTx()

const CWalletTx * CWallet::GetWalletTx ( const uint256 hash) const

◆ HaveKey()

bool CWallet::HaveKey ( const CKeyID address) const
overridevirtual

◆ IncOrderPosNext()

int64_t CWallet::IncOrderPosNext ( WalletBatch batch = nullptr)

Increment the next transaction order id.

Returns
next transaction order id

Definition at line 997 of file wallet.cpp.

References AssertLockHeld(), CWallet::cs_wallet, CWallet::nOrderPosNext, and WalletBatch::WriteOrderPosNext().

Referenced by CWallet::AccountMove(), and CWallet::AddToWallet().

◆ InMempool()

◆ IsAllFromMe()

bool CWallet::IsAllFromMe ( const CTransaction tx,
const isminefilter filter 
) const

Returns whether all of the inputs match the filter.

Definition at line 1878 of file wallet.cpp.

References CWallet::cs_wallet, COutPoint::hash, CWallet::IsMine(), LOCK, CWallet::mapWallet, COutPoint::n, CTxIn::prevout, CMerkleTx::tx, and CTransaction::vin.

◆ IsChange()

◆ IsDenominated()

bool CWallet::IsDenominated ( const COutPoint outpoint) const

◆ IsEquivalentTo()

bool CWalletTx::IsEquivalentTo ( const CWalletTx tx) const

Definition at line 2452 of file wallet.cpp.

References CMerkleTx::tx, and CMutableTransaction::vin.

Referenced by CWallet::SyncMetaData().

◆ IsFromMe()

bool CWallet::IsFromMe ( const CTransaction tx) const

should probably be renamed to IsRelevantToMe

Definition at line 1861 of file wallet.cpp.

References CWallet::GetDebit(), and ISMINE_ALL.

Referenced by CWallet::AddToWalletIfInvolvingMe().

◆ IsFullyMixed()

◆ IsHDEnabled()

bool CWallet::IsHDEnabled ( ) const

◆ IsMine() [1/3]

◆ IsMine() [2/3]

isminetype CWallet::IsMine ( const CTxOut txout) const

Definition at line 1703 of file wallet.cpp.

References IsMine(), and CTxOut::scriptPubKey.

◆ IsMine() [3/3]

bool CWallet::IsMine ( const CTransaction tx) const

Definition at line 1853 of file wallet.cpp.

References CWallet::IsMine(), and CTransaction::vout.

◆ IsSpent()

◆ IsTrusted()

◆ LoadCryptedKey()

bool CWallet::LoadCryptedKey ( const CPubKey vchPubKey,
const std::vector< unsigned char > &  vchCryptedSecret 
)

Adds an encrypted key to the store, without saving it to disk (used by LoadWallet)

Definition at line 446 of file wallet.cpp.

References CCryptoKeyStore::AddCryptedKey().

Referenced by ReadKeyValue().

◆ LoadCScript()

bool CWallet::LoadCScript ( const CScript redeemScript)

◆ LoadHDPubKey()

bool CWallet::LoadHDPubKey ( const CHDPubKey hdPubKey)

loads a HDPubKey into the wallets memory

Definition at line 336 of file wallet.cpp.

References AssertLockHeld(), CWallet::cs_wallet, CHDPubKey::extPubKey, CPubKey::GetID(), CWallet::mapHdPubKeys, and CExtPubKey::pubkey.

Referenced by ReadKeyValue().

◆ LoadKeyMetadata()

bool CWallet::LoadKeyMetadata ( const CKeyID keyID,
const CKeyMetadata metadata 
)

Load metadata (used by LoadWallet)

Definition at line 430 of file wallet.cpp.

References AssertLockHeld(), CWallet::cs_wallet, CWallet::mapKeyMetadata, CKeyMetadata::nCreateTime, and CWallet::UpdateTimeFirstKey().

Referenced by ReadKeyValue().

◆ LoadScriptMetadata()

bool CWallet::LoadScriptMetadata ( const CScriptID script_id,
const CKeyMetadata metadata 
)

◆ LoadToWallet()

◆ LoadWatchOnly()

bool CWallet::LoadWatchOnly ( const CScript dest)

Adds a watch-only address to the store, without saving it to disk (used by LoadWallet)

Definition at line 519 of file wallet.cpp.

References CBasicKeyStore::AddWatchOnly().

Referenced by ReadKeyValue().

◆ MarkConflicted()

◆ MarkDirty()

◆ Priority()

int COutput::Priority ( ) const

◆ ReacceptWalletTransactions()

◆ RelayWalletTransaction()

◆ RemoveWatchOnly()

bool CWallet::RemoveWatchOnly ( const CScript dest)
overridevirtual

◆ ReorderTransactions()

◆ RescanFromTime()

int64_t CWallet::RescanFromTime ( int64_t  startTime,
const WalletRescanReserver reserver,
bool  update 
)

Scan active chain for relevant transactions after importing keys.

This should be called whenever new keys are added to the wallet, with the oldest key creation time.

Returns
Earliest timestamp that could be successfully scanned from. Timestamp returned will be higher than startTime if relevant blocks could not be read.

Definition at line 1993 of file wallet.cpp.

References chainActive, cs_main, CChain::FindEarliestAtLeast(), CBlockIndex::GetBlockTimeMax(), CChain::Height(), LOCK, LogPrintf, CBlockIndex::nHeight, CWallet::ScanForWalletTransactions(), and TIMESTAMP_WINDOW.

Referenced by importaddress(), importmulti(), importprivkey(), importpubkey(), and importwallet().

◆ ResendWalletTransactions()

void CWallet::ResendWalletTransactions ( int64_t  nBestBlockTime,
CConnman connman 
)
overridevirtual

Tells listeners to broadcast their data.

Reimplemented from CValidationInterface.

Definition at line 2486 of file wallet.cpp.

References CWallet::fBroadcastTransactions, GetRand(), GetTime(), LogPrintf, CWallet::nLastResend, CWallet::nNextResend, and CWallet::ResendWalletTransactionsBefore().

◆ ResendWalletTransactionsBefore()

std::vector< uint256 > CWallet::ResendWalletTransactionsBefore ( int64_t  nTime,
CConnman connman 
)

◆ ScanForWalletTransactions()

CBlockIndex * CWallet::ScanForWalletTransactions ( CBlockIndex pindexStart,
CBlockIndex pindexStop,
const WalletRescanReserver reserver,
bool  fUpdate = false 
)

Scan the block chain (starting in pindexStart) for transactions from or to us.

If fUpdate is true, found transactions that already exist in the wallet will be updated.

Returns null if scan was successful. Otherwise, if a complete rescan was not possible (due to pruning or corruption), returns pointer to the most recent block that could not be scanned.

If pindexStop is not a nullptr, the scan will stop at the block-index defined by pindexStop

Caller needs to make sure pindexStop (and the optional pindexStart) are on the main chain after to the addition of any new keys you want to detect transactions for.

Definition at line 2030 of file wallet.cpp.

References _(), CWallet::AddToWalletIfInvolvingMe(), chainActive, CChain::Contains(), cs_main, CWallet::cs_wallet, CWallet::fAbortRescan, GetTime(), GuessVerificationProgress(), WalletRescanReserver::isReserved(), LOCK, LOCK2, LogPrintf, CChain::Next(), CBlockIndex::nHeight, Params(), ReadBlockFromDisk(), CWallet::ShowProgress, CChain::Tip(), CChainParams::TxData(), and CBlock::vtx.

Referenced by BOOST_FIXTURE_TEST_CASE(), importelectrumwallet(), rescanblockchain(), and CWallet::RescanFromTime().

◆ SetBestChain()

void CWallet::SetBestChain ( const CBlockLocator locator)
overridevirtual

Notifies listeners of the new active block chain on-disk.

Called on a background thread.

Reimplemented from CValidationInterface.

Definition at line 641 of file wallet.cpp.

References CWallet::database, and WalletBatch::WriteBestBlock().

◆ SetCryptedHDChain()

bool CWallet::SetCryptedHDChain ( WalletBatch batch,
const CHDChain chain,
bool  memonly 
)

◆ SetCryptedHDChainSingle()

bool CWallet::SetCryptedHDChainSingle ( const CHDChain chain,
bool  memonly 
)

Definition at line 1820 of file wallet.cpp.

References CWallet::database, and CWallet::SetCryptedHDChain().

Referenced by ReadKeyValue().

◆ SetHDChain()

bool CWallet::SetHDChain ( WalletBatch batch,
const CHDChain chain,
bool  memonly 
)

◆ SetHDChainSingle()

bool CWallet::SetHDChainSingle ( const CHDChain chain,
bool  memonly 
)

Set the HD chain model (chain child index counters) using temporary wallet db object which causes db flush every time these methods are used.

Definition at line 1814 of file wallet.cpp.

References CWallet::database, and CWallet::SetHDChain().

Referenced by CWallet::GenerateNewHDChain(), and ReadKeyValue().

◆ SetMaxVersion()

bool CWallet::SetMaxVersion ( int  nVersion)

change which version we're allowed to upgrade to (note that this does not immediately imply upgrading to that format)

Definition at line 673 of file wallet.cpp.

References CWallet::cs_wallet, LOCK, CWallet::nWalletMaxVersion, and CWallet::nWalletVersion.

◆ SetMinVersion()

bool CWallet::SetMinVersion ( enum WalletFeature  nVersion,
WalletBatch batch_in = nullptr,
bool  fExplicit = false 
)

signify that a particular wallet feature is now used. this may change nWalletVersion and nWalletMaxVersion if those are lower

Definition at line 647 of file wallet.cpp.

References CWallet::cs_wallet, CWallet::database, FEATURE_LATEST, LOCK, CWallet::nWalletMaxVersion, CWallet::nWalletVersion, and WalletBatch::WriteMinVersion().

Referenced by CWallet::EncryptWallet(), and CWallet::GenerateNewKey().

◆ SyncMetaData()

void CWallet::SyncMetaData ( std::pair< TxSpends::iterator, TxSpends::iterator >  range)
private

◆ SyncTransaction()

◆ ToString()

std::string COutput::ToString ( ) const

◆ TransactionAddedToMempool()

void CWallet::TransactionAddedToMempool ( const CTransactionRef ptxn,
int64_t  nAcceptTime 
)
overridevirtual

Notifies listeners of a transaction having been added to mempool.

Called on a background thread.

Reimplemented from CValidationInterface.

Definition at line 1431 of file wallet.cpp.

References cs_main, CWallet::cs_wallet, LOCK2, CWallet::mapWallet, and CWallet::SyncTransaction().

◆ TransactionCanBeAbandoned()

bool CWallet::TransactionCanBeAbandoned ( const uint256 hashTx) const

◆ TransactionRemovedFromMempool()

void CWallet::TransactionRemovedFromMempool ( const CTransactionRef ptx)
overridevirtual

Notifies listeners of a transaction leaving mempool.

This only fires for transactions which leave mempool because of expiry, size limiting, reorg (changes in lock times/coinbase maturity), or replacement. This does not include any transactions which are included in BlockConnectedDisconnected either in block->vtx or in txnConflicted.

Called on a background thread.

Reimplemented from CValidationInterface.

Definition at line 1441 of file wallet.cpp.

References CWallet::cs_wallet, LOCK, and CWallet::mapWallet.

Referenced by CWallet::BlockConnected().

◆ Unlock()

◆ UpdateTimeFirstKey()

void CWallet::UpdateTimeFirstKey ( int64_t  nCreateTime)

Update wallet first key creation time.

This should be called whenever keys are added to the wallet, with the oldest key creation time.

Definition at line 455 of file wallet.cpp.

References AssertLockHeld(), CWallet::cs_wallet, and CWallet::nTimeFirstKey.

Referenced by CWallet::AddWatchOnly(), CWallet::DeriveNewChildKey(), CWallet::GenerateNewKey(), importelectrumwallet(), importprivkey(), importwallet(), CWallet::LoadKeyMetadata(), CWallet::LoadScriptMetadata(), WalletBatch::LoadWallet(), and ProcessImport().

Released under the MIT license