Bitcoin ABC  0.22.15
P2P Digital Currency
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
CWallet Class Referencefinalabstract

A CWallet maintains a set of transactions and balances, and provides the ability to create new transactions. More...

#include <wallet.h>

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

Classes

struct  Balance
 
struct  ScanResult
 

Public Types

typedef std::map< unsigned int, CMasterKeyMasterKeyMap
 
typedef std::multimap< int64_t, CWalletTx * > TxItems
 
using UpdateWalletTxFn = std::function< bool(CWalletTx &wtx, bool new_tx)>
 Callback for updating transaction metadata in mapWallet. More...
 

Public Member Functions

WalletDatabaseGetDBHandle ()
 Get database handle used by this wallet. More...
 
WalletDatabaseGetDatabase () override
 
bool SelectCoins (const std::vector< COutput > &vAvailableCoins, const Amount nTargetValue, std::set< CInputCoin > &setCoinsRet, Amount &nValueRet, const CCoinControl &coin_control, CoinSelectionParams &coin_selection_params, bool &bnb_used) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet)
 Select a set of coins such that nValueRet >= nTargetValue and at least all coins from coinControl are selected; Never select unconfirmed coins if they are not ours. More...
 
const WalletLocationGetLocation () const
 
const std::string & GetName () const
 Get a name for this wallet for logging/debugging purposes. More...
 
 CWallet (interfaces::Chain *chain, const WalletLocation &location, std::unique_ptr< WalletDatabase > _database)
 Construct wallet with specified name and database implementation. More...
 
 ~CWallet ()
 
const CChainParamsGetChainParams () const override
 
bool IsCrypted () const
 
bool IsLocked () const override
 
bool Lock ()
 
bool HaveChain () const
 Interface to assert chain access. More...
 
std::map< TxId, CWalletTx > mapWallet GUARDED_BY (cs_wallet)
 
int64_t nOrderPosNext GUARDED_BY (cs_wallet)=0
 
std::map< CTxDestination, CAddressBookData > m_address_book GUARDED_BY (cs_wallet)
 
const CAddressBookDataFindAddressBookEntry (const CTxDestination &, bool allow_change=false) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet)
 
std::set< COutPoint > setLockedCoins GUARDED_BY (cs_wallet)
 
interfaces::Chainchain () const
 Interface for accessing chain state. More...
 
const CWalletTxGetWalletTx (const TxId &txid) const
 
bool CanSupportFeature (enum WalletFeature wf) const override EXCLUSIVE_LOCKS_REQUIRED(cs_wallet)
 check whether we are allowed to upgrade (or already support) to the named feature More...
 
void AvailableCoins (std::vector< COutput > &vCoins, bool fOnlySafe=true, const CCoinControl *coinControl=nullptr, const Amount nMinimumAmount=SATOSHI, const Amount nMaximumAmount=MAX_MONEY, const Amount nMinimumSumAmount=MAX_MONEY, const uint64_t nMaximumCount=0) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet)
 populate vCoins with vector of available COutputs. More...
 
std::map< CTxDestination, std::vector< COutput > > ListCoins () const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet)
 Return list of available coins and locked coins grouped by non-change output address. More...
 
const CTxOutFindNonChangeParentOutput (const CTransaction &tx, int output) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet)
 Find non-change parent output. More...
 
bool SelectCoinsMinConf (const Amount nTargetValue, const CoinEligibilityFilter &eligibility_filter, std::vector< OutputGroup > groups, std::set< CInputCoin > &setCoinsRet, Amount &nValueRet, const CoinSelectionParams &coin_selection_params, bool &bnb_used) const
 Shuffle and select coins until nTargetValue is reached while avoiding small change; This method is stochastic for some inputs and upon completion the coin set and corresponding actual target value is assembled. More...
 
bool IsSpent (const COutPoint &outpoint) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet)
 Outpoint is spent if any non-conflicted transaction, spends it: More...
 
bool IsSpentKey (const TxId &txid, unsigned int n) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet)
 
void SetSpentKeyState (WalletBatch &batch, const TxId &txid, unsigned int n, bool used, std::set< CTxDestination > &tx_destinations) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet)
 
std::vector< OutputGroupGroupOutputs (const std::vector< COutput > &outputs, bool single_coin, const size_t max_ancestors) const
 
bool IsLockedCoin (const COutPoint &outpoint) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet)
 
void LockCoin (const COutPoint &output) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet)
 
void UnlockCoin (const COutPoint &output) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet)
 
void UnlockAllCoins () EXCLUSIVE_LOCKS_REQUIRED(cs_wallet)
 
void ListLockedCoins (std::vector< COutPoint > &vOutpts) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet)
 
void AbortRescan ()
 
bool IsAbortingRescan () const
 
bool IsScanning () const
 
int64_t ScanningDuration () const
 
double ScanningProgress () const
 
void UpgradeKeyMetadata () EXCLUSIVE_LOCKS_REQUIRED(cs_wallet)
 Upgrade stored CKeyMetadata objects to store key origin info as KeyOriginInfo. More...
 
bool LoadMinVersion (int nVersion) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet)
 
bool AddDestData (WalletBatch &batch, const CTxDestination &dest, const std::string &key, const std::string &value) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet)
 Adds a destination data tuple to the store, and saves it to disk When adding new fields, take care to consider how DelAddressBook should handle it! More...
 
bool EraseDestData (WalletBatch &batch, const CTxDestination &dest, const std::string &key) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet)
 Erases a destination data tuple in the store and on disk. More...
 
void LoadDestData (const CTxDestination &dest, const std::string &key, const std::string &value) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet)
 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 EXCLUSIVE_LOCKS_REQUIRED(cs_wallet)
 Look up a destination data tuple in the store, return true if found false otherwise. More...
 
std::vector< std::string > GetDestValues (const std::string &prefix) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet)
 Get all destination values matching a prefix. More...
 
int64_t nRelockTime GUARDED_BY (cs_wallet)
 Holds a timestamp at which point the wallet is scheduled (externally) to be relocked. More...
 
bool Unlock (const SecureString &strWalletPassphrase, bool accept_no_keys=false)
 
bool ChangeWalletPassphrase (const SecureString &strOldWalletPassphrase, const SecureString &strNewWalletPassphrase)
 
bool EncryptWallet (const SecureString &strWalletPassphrase)
 
void GetKeyBirthTimes (std::map< CKeyID, int64_t > &mapKeyBirth) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet)
 
unsigned int ComputeTimeSmart (const CWalletTx &wtx) const
 Compute smart timestamp for a transaction being added to the wallet. More...
 
int64_t IncOrderPosNext (WalletBatch *batch=nullptr) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet)
 Increment the next transaction order id. More...
 
DBErrors ReorderTransactions ()
 
void MarkDirty ()
 
CWalletTxAddToWallet (CTransactionRef tx, const CWalletTx::Confirmation &confirm, const UpdateWalletTxFn &update_wtx=nullptr, bool fFlushOnClose=true)
 
bool LoadToWallet (const TxId &txid, const UpdateWalletTxFn &fill_wtx) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet)
 
void transactionAddedToMempool (const CTransactionRef &tx) override
 
void blockConnected (const CBlock &block, int height) override
 
void blockDisconnected (const CBlock &block, int height) override
 
void updatedBlockTip () override
 
int64_t RescanFromTime (int64_t startTime, const WalletRescanReserver &reserver, bool update)
 Scan active chain for relevant transactions after importing keys. More...
 
ScanResult ScanForWalletTransactions (const BlockHash &start_block, int start_height, std::optional< int > max_height, const WalletRescanReserver &reserver, bool fUpdate)
 Scan the block chain (starting in start_block) for transactions from or to us. More...
 
void transactionRemovedFromMempool (const CTransactionRef &ptx) override
 
void ReacceptWalletTransactions () EXCLUSIVE_LOCKS_REQUIRED(cs_wallet)
 
void ResendWalletTransactions ()
 
Balance GetBalance (int min_depth=0, bool avoid_reuse=true) const
 
Amount GetAvailableBalance (const CCoinControl *coinControl=nullptr) const
 
OutputType TransactionChangeType (OutputType change_type, const std::vector< CRecipient > &vecSend)
 
bool FundTransaction (CMutableTransaction &tx, Amount &nFeeRet, int &nChangePosInOut, bilingual_str &error, bool lockUnspents, const std::set< int > &setSubtractFeeFromOutputs, CCoinControl coinControl)
 Insert additional inputs into the transaction by calling CreateTransaction();. More...
 
bool SignTransaction (CMutableTransaction &tx) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet)
 
bool SignTransaction (CMutableTransaction &tx, const std::map< COutPoint, Coin > &coins, SigHashType sighash, std::map< int, std::string > &input_errors) const
 
SigningResult SignMessage (const std::string &message, const PKHash &pkhash, std::string &str_sig) const
 
TransactionError FillPSBT (PartiallySignedTransaction &psbtx, bool &complete, SigHashType sighash_type=SigHashType().withForkId(), bool sign=true, bool bip32derivs=true) const
 Fills out a PSBT with information from the wallet. More...
 
bool CreateTransaction (const std::vector< CRecipient > &vecSend, CTransactionRef &tx, Amount &nFeeRet, int &nChangePosInOut, bilingual_str &error, const CCoinControl &coin_control, bool sign=true)
 Create a new transaction paying the recipients with a set of coins selected by SelectCoins(); Also create the change output, when needed. More...
 
void CommitTransaction (CTransactionRef tx, mapValue_t mapValue, std::vector< std::pair< std::string, std::string >> orderForm)
 Submit the transaction to the node's mempool and then relay to peers. More...
 
bool DummySignTx (CMutableTransaction &txNew, const std::set< CTxOut > &txouts, bool use_max_sig=false) const
 
bool DummySignTx (CMutableTransaction &txNew, const std::vector< CTxOut > &txouts, bool use_max_sig=false) const
 
bool DummySignInput (CTxIn &tx_in, const CTxOut &txout, bool use_max_sig=false) const
 
bool ImportScripts (const std::set< CScript > scripts, int64_t timestamp) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet)
 
bool ImportPrivKeys (const std::map< CKeyID, CKey > &privkey_map, const int64_t timestamp) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet)
 
bool ImportPubKeys (const std::vector< CKeyID > &ordered_pubkeys, const std::map< CKeyID, CPubKey > &pubkey_map, const std::map< CKeyID, std::pair< CPubKey, KeyOriginInfo >> &key_origins, const bool add_keypool, const bool internal, const int64_t timestamp) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet)
 
bool ImportScriptPubKeys (const std::string &label, const std::set< CScript > &script_pub_keys, const bool have_solving_data, const bool apply_label, const int64_t timestamp) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet)
 
size_t KeypoolCountExternalKeys () const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet)
 
bool TopUpKeyPool (unsigned int kpSize=0)
 
int64_t GetOldestKeyPoolTime () const
 
std::set< std::set< CTxDestination > > GetAddressGroupings () const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet)
 
std::map< CTxDestination, AmountGetAddressBalances () const
 
std::set< CTxDestinationGetLabelAddresses (const std::string &label) const
 
void MarkDestinationsDirty (const std::set< CTxDestination > &destinations) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet)
 Marks all outputs in each one of the destinations dirty, so their cache is reset and does not return outdated information. More...
 
bool GetNewDestination (const OutputType type, const std::string label, CTxDestination &dest, std::string &error)
 
bool GetNewChangeDestination (const OutputType type, CTxDestination &dest, std::string &error)
 
isminetype IsMine (const CTxDestination &dest) const
 
isminetype IsMine (const CScript &script) const
 
isminetype IsMine (const CTxIn &txin) const
 
Amount GetDebit (const CTxIn &txin, const isminefilter &filter) const
 Returns amount of debit if the input matches the filter, otherwise returns 0. More...
 
isminetype IsMine (const CTxOut &txout) const
 
Amount GetCredit (const CTxOut &txout, const isminefilter &filter) const
 
bool IsChange (const CTxOut &txout) const
 
bool IsChange (const CScript &script) const
 
Amount GetChange (const CTxOut &txout) const
 
bool IsMine (const CTransaction &tx) const
 
bool IsFromMe (const CTransaction &tx) const
 should probably be renamed to IsRelevantToMe More...
 
Amount GetDebit (const CTransaction &tx, const isminefilter &filter) const
 
bool IsAllFromMe (const CTransaction &tx, const isminefilter &filter) const
 Returns whether all of the inputs match the filter. More...
 
Amount GetCredit (const CTransaction &tx, const isminefilter &filter) const
 
Amount GetChange (const CTransaction &tx) const
 
void chainStateFlushed (const CBlockLocator &loc) override
 
DBErrors LoadWallet (bool &fFirstRunRet)
 
DBErrors ZapWalletTx (std::list< CWalletTx > &vWtx)
 
DBErrors ZapSelectTx (std::vector< TxId > &txIdsIn, std::vector< TxId > &txIdsOut) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet)
 
bool SetAddressBook (const CTxDestination &address, const std::string &strName, const std::string &purpose)
 
bool DelAddressBook (const CTxDestination &address)
 
unsigned int GetKeyPoolSize () const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet)
 
void SetMinVersion (enum WalletFeature, WalletBatch *batch_in=nullptr, bool fExplicit=false) override
 signify that a particular wallet feature is now used. More...
 
bool SetMaxVersion (int nVersion)
 change which version we're allowed to upgrade to (note that this does not immediately imply upgrading to that format) More...
 
int GetVersion () const
 get the current wallet format (the oldest client version guaranteed to understand this wallet) More...
 
std::set< TxIdGetConflicts (const TxId &txid) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet)
 Get wallet transactions that conflict with given transaction (spend same outputs) More...
 
bool HasWalletSpend (const TxId &txid) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet)
 Check if a given transaction has any of its outputs spent by another transaction in the wallet. More...
 
void Flush (bool shutdown=false)
 Flush wallet (bitdb flush) More...
 
bool GetBroadcastTransactions () const
 Inquire whether this wallet broadcasts transactions. More...
 
void SetBroadcastTransactions (bool broadcast)
 Set whether this wallet broadcasts transactions. More...
 
bool TransactionCanBeAbandoned (const TxId &txid) const
 Return whether transaction can be abandoned. More...
 
bool AbandonTransaction (const TxId &txid)
 Mark a transaction (and it in-wallet descendants) as abandoned so its inputs may be respent. More...
 
void postInitProcess ()
 Wallet post-init setup Gives the wallet a chance to register repetitive tasks and complete post-init tasks. More...
 
bool BackupWallet (const std::string &strDest) const
 
bool IsHDEnabled () const
 
bool CanGetAddresses (bool internal=false) const
 Returns true if the wallet can give out new addresses. More...
 
void BlockUntilSyncedToCurrentChain () const LOCKS_EXCLUDED(cs_main
 Blocks until the wallet state is up-to-date to /at least/ the current chain at the time this function is entered. More...
 
void SetWalletFlag (uint64_t flags)
 Set a single wallet flag. More...
 
void UnsetWalletFlag (uint64_t flag)
 Unsets a single wallet flag. More...
 
bool IsWalletFlagSet (uint64_t flag) const override
 Check if a certain wallet flag is set. More...
 
bool SetWalletFlags (uint64_t overwriteFlags, bool memOnly)
 Overwrite all flags by the given uint64_t. More...
 
bool IsLegacy () const
 Determine if we are a legacy wallet. More...
 
const std::string GetDisplayName () const override
 Returns a bracketed wallet name for displaying in logs, will return [default wallet] if the wallet has no name. More...
 
template<typename... Params>
void WalletLogPrintf (std::string fmt, Params... parameters) const
 Prepends the wallet name in logging output to ease debugging in multi-wallet use cases. More...
 
template<typename... Params>
void WalletLogPrintfToBeContinued (std::string fmt, Params... parameters) const
 
bool UpgradeWallet (int version, bilingual_str &error, std::vector< bilingual_str > &warnings)
 Upgrade the wallet. More...
 
std::set< ScriptPubKeyMan * > GetActiveScriptPubKeyMans () const
 Returns all unique ScriptPubKeyMans in m_internal_spk_managers and m_external_spk_managers. More...
 
std::set< ScriptPubKeyMan * > GetAllScriptPubKeyMans () const
 Returns all unique ScriptPubKeyMans. More...
 
ScriptPubKeyManGetScriptPubKeyMan (const OutputType &type, bool internal) const
 Get the ScriptPubKeyMan for the given OutputType and internal/external chain. More...
 
ScriptPubKeyManGetScriptPubKeyMan (const CScript &script) const
 Get the ScriptPubKeyMan for a script. More...
 
ScriptPubKeyManGetScriptPubKeyMan (const uint256 &id) const
 Get the ScriptPubKeyMan by id. More...
 
std::set< ScriptPubKeyMan * > GetScriptPubKeyMans (const CScript &script, SignatureData &sigdata) const
 Get all of the ScriptPubKeyMans for a script given additional information in sigdata (populated by e.g. More...
 
std::unique_ptr< SigningProviderGetSolvingProvider (const CScript &script) const
 Get the SigningProvider for a script. More...
 
std::unique_ptr< SigningProviderGetSolvingProvider (const CScript &script, SignatureData &sigdata) const
 
LegacyScriptPubKeyManGetLegacyScriptPubKeyMan () const
 Get the LegacyScriptPubKeyMan which is used for all types, internal, and external. More...
 
LegacyScriptPubKeyManGetOrCreateLegacyScriptPubKeyMan ()
 
void SetupLegacyScriptPubKeyMan ()
 Make a LegacyScriptPubKeyMan and set it for all types, internal, and external. More...
 
const CKeyingMaterialGetEncryptionKey () const override
 
bool HasEncryptionKeys () const override
 
int GetLastBlockHeight () const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet)
 Get last block processed height. More...
 
BlockHash GetLastBlockHash () const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet)
 
void SetLastBlockProcessed (int block_height, BlockHash block_hash) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet)
 Set last block processed height, currently only use in unit test. More...
 
void ConnectScriptPubKeyManNotifiers ()
 Connect the signals from ScriptPubKeyMans to the signals in CWallet. More...
 
void LoadDescriptorScriptPubKeyMan (uint256 id, WalletDescriptor &desc)
 Instantiate a descriptor ScriptPubKeyMan from the WalletDescriptor and load it. More...
 
void SetActiveScriptPubKeyMan (uint256 id, OutputType type, bool internal, bool memonly=false)
 Sets the active ScriptPubKeyMan for the specified type and internal. More...
 
void SetupDescriptorScriptPubKeyMans ()
 Create new DescriptorScriptPubKeyMans and add them to the wallet. More...
 
DescriptorScriptPubKeyManGetDescriptorScriptPubKeyMan (const WalletDescriptor &desc) const
 Return the DescriptorScriptPubKeyMan for a WalletDescriptor if it is already in the wallet. More...
 
ScriptPubKeyManAddWalletDescriptor (WalletDescriptor &desc, const FlatSigningProvider &signing_provider, const std::string &label)
 Add a descriptor to the wallet, return a ScriptPubKeyMan & associated output type. More...
 
- Public Member Functions inherited from WalletStorage
virtual ~WalletStorage ()=default
 
- Public Member Functions inherited from interfaces::Chain::Notifications
virtual ~Notifications ()
 

Static Public Member Functions

static bool Verify (const CChainParams &chainParams, interfaces::Chain &chain, const WalletLocation &location, bilingual_str &error_string, std::vector< bilingual_str > &warnings)
 Verify wallet naming and perform salvage on the wallet if required. More...
 
static std::shared_ptr< CWalletCreateWalletFromFile (const CChainParams &chainParams, interfaces::Chain &chain, const WalletLocation &location, bilingual_str &error, std::vector< bilingual_str > &warnings, uint64_t wallet_creation_flags=0)
 Initializes the wallet, returns a new CWallet instance or a null pointer in case of an error. More...
 

Public Attributes

RecursiveMutex cs_wallet
 
MasterKeyMap mapMasterKeys
 
unsigned int nMasterKeyMaxID = 0
 
TxItems wtxOrdered
 
uint64_t nAccountingEntryNumber = 0
 
std::unique_ptr< interfaces::Handlerm_chain_notifications_handler
 Registered interfaces::Chain::Notifications handler. More...
 
Mutex m_unlock_mutex
 
CFeeRate m_pay_tx_fee {DEFAULT_PAY_TX_FEE}
 
bool m_spend_zero_conf_change {DEFAULT_SPEND_ZEROCONF_CHANGE}
 
bool m_allow_fallback_fee {true}
 will be false if -fallbackfee=0 More...
 
CFeeRate m_min_fee {DEFAULT_TRANSACTION_MINFEE_PER_KB}
 
CFeeRate m_fallback_fee {DEFAULT_FALLBACK_FEE}
 If fee estimation does not have enough data to provide estimates, use this fee instead. More...
 
Amount m_max_aps_fee {DEFAULT_MAX_AVOIDPARTIALSPEND_FEE}
 note: this is absolute fee, not fee rate More...
 
OutputType m_default_address_type {DEFAULT_ADDRESS_TYPE}
 
OutputType m_default_change_type {DEFAULT_CHANGE_TYPE}
 
Amount m_default_max_tx_fee {DEFAULT_TRANSACTION_MAXFEE}
 Absolute maximum transaction fee (in satoshis) used by default for the wallet. More...
 
boost::signals2::signal< void()> NotifyUnload
 Wallet is about to be unloaded. More...
 
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 TxId &txid, 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(bool fHaveWatchOnly)> NotifyWatchonlyChanged
 Watch-only address added. More...
 
boost::signals2::signal< void()> NotifyCanGetAddressesChanged
 Keypool has new keys. More...
 
boost::signals2::signal< void(CWallet *wallet)> NotifyStatusChanged
 Wallet status (encrypted, locked) changed. More...
 
void cs_wallet
 

Private Types

typedef std::multimap< COutPoint, TxIdTxSpends
 Used to keep track of spent outpoints, and detect and report conflicts (double-spends or mutated transactions where the mutant gets mined). More...
 

Private Member Functions

CKeyingMaterial vMasterKey GUARDED_BY (cs_wallet)
 
bool Unlock (const CKeyingMaterial &vMasterKeyIn, bool accept_no_keys=false)
 
int nWalletVersion GUARDED_BY (cs_wallet)
 the current wallet version: clients below this version are not able to load the wallet More...
 
int nWalletMaxVersion GUARDED_BY (cs_wallet)
 the maximum wallet format version: memory-only variable that specifies to what version this wallet may be upgraded More...
 
TxSpends mapTxSpends GUARDED_BY (cs_wallet)
 
void AddToSpends (const COutPoint &outpoint, const TxId &wtxid) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet)
 
void AddToSpends (const TxId &wtxid) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet)
 
bool AddToWalletIfInvolvingMe (const CTransactionRef &tx, CWalletTx::Confirmation confirm, bool fUpdate) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet)
 Add a transaction to the wallet, or update it. More...
 
void MarkConflicted (const BlockHash &hashBlock, int conflicting_height, const TxId &txid)
 Mark a transaction (and its in-wallet descendants) as conflicting with a particular block. More...
 
void MarkInputsDirty (const CTransactionRef &tx) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet)
 Mark a transaction's inputs dirty, thus forcing the outputs to be recomputed. More...
 
void SyncMetaData (std::pair< TxSpends::iterator, TxSpends::iterator >) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet)
 
void SyncTransaction (const CTransactionRef &tx, CWalletTx::Confirmation confirm, bool update_tx=true) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet)
 Used by TransactionAddedToMemorypool/BlockConnected/Disconnected/ScanForWalletTransactions. More...
 
bool SetAddressBookWithDB (WalletBatch &batch, const CTxDestination &address, const std::string &strName, const std::string &strPurpose)
 
void UnsetWalletFlagWithDB (WalletBatch &batch, uint64_t flag)
 Unsets a wallet flag and saves it to disk. More...
 
void UnsetBlankWalletFlag (WalletBatch &batch) override
 Unset the blank wallet flag and saves it to disk. More...
 
BlockHash m_last_block_processed GUARDED_BY (cs_wallet)
 The following is used to keep track of how far behind the wallet is from the chain sync, and to allow clients to block on us being caught up. More...
 
int m_last_block_processed_height GUARDED_BY (cs_wallet)
 
bool CreateTransactionInternal (const std::vector< CRecipient > &vecSend, CTransactionRef &tx, Amount &nFeeRet, int &nChangePosInOut, bilingual_str &error, const CCoinControl &coin_control, bool sign)
 

Private Attributes

std::atomic< bool > fAbortRescan {false}
 
std::atomic< bool > fScanningWallet {false}
 
std::atomic< int64_t > m_scanning_start {0}
 
std::atomic< double > m_scanning_progress {0}
 
int64_t nNextResend = 0
 
bool fBroadcastTransactions = false
 
std::atomic< int64_t > m_best_block_time {0}
 
std::atomic< uint64_t > m_wallet_flags {0}
 
interfaces::Chainm_chain
 Interface for accessing chain state. More...
 
WalletLocation m_location
 Wallet location which includes wallet name (see WalletLocation). More...
 
std::unique_ptr< WalletDatabasedatabase
 Internal database handle. More...
 
std::map< OutputType, ScriptPubKeyMan * > m_external_spk_managers
 
std::map< OutputType, ScriptPubKeyMan * > m_internal_spk_managers
 
std::map< uint256, std::unique_ptr< ScriptPubKeyMan > > m_spk_managers
 

Friends

class WalletRescanReserver
 

Detailed Description

A CWallet maintains a set of transactions and balances, and provides the ability to create new transactions.

Definition at line 679 of file wallet.h.

Member Typedef Documentation

◆ MasterKeyMap

typedef std::map<unsigned int, CMasterKey> CWallet::MasterKeyMap

Definition at line 850 of file wallet.h.

◆ TxItems

typedef std::multimap<int64_t, CWalletTx *> CWallet::TxItems

Definition at line 877 of file wallet.h.

◆ TxSpends

typedef std::multimap<COutPoint, TxId> CWallet::TxSpends
private

Used to keep track of spent outpoints, and detect and report conflicts (double-spends or mutated transactions where the mutant gets mined).

Definition at line 712 of file wallet.h.

◆ UpdateWalletTxFn

using CWallet::UpdateWalletTxFn = std::function<bool(CWalletTx &wtx, bool new_tx)>

Callback for updating transaction metadata in mapWallet.

Parameters
wtx- reference to mapWallet transaction to update
new_tx- true if wtx is newly inserted, false if it previously existed
Returns
true if wtx is changed and needs to be saved to disk, otherwise false

Definition at line 1057 of file wallet.h.

Constructor & Destructor Documentation

◆ CWallet()

CWallet::CWallet ( interfaces::Chain chain,
const WalletLocation location,
std::unique_ptr< WalletDatabase _database 
)
inline

Construct wallet with specified name and database implementation.

Definition at line 855 of file wallet.h.

◆ ~CWallet()

CWallet::~CWallet ( )
inline

Definition at line 860 of file wallet.h.

Here is the call graph for this function:

Member Function Documentation

◆ AbortRescan()

void CWallet::AbortRescan ( )
inline

Definition at line 976 of file wallet.h.

Here is the caller graph for this function:

◆ AddDestData()

bool CWallet::AddDestData ( WalletBatch batch,
const CTxDestination dest,
const std::string &  key,
const std::string &  value 
)

Adds a destination data tuple to the store, and saves it to disk When adding new fields, take care to consider how DelAddressBook should handle it!

Definition at line 4056 of file wallet.cpp.

Here is the call graph for this function:

◆ AddWalletDescriptor()

ScriptPubKeyMan * CWallet::AddWalletDescriptor ( WalletDescriptor desc,
const FlatSigningProvider signing_provider,
const std::string &  label 
)

Add a descriptor to the wallet, return a ScriptPubKeyMan & associated output type.

Definition at line 4970 of file wallet.cpp.

Here is the call graph for this function:

◆ BackupWallet()

bool CWallet::BackupWallet ( const std::string &  strDest) const

Definition at line 4598 of file wallet.cpp.

Here is the caller graph for this function:

◆ CanSupportFeature()

bool CWallet::CanSupportFeature ( enum WalletFeature  wf) const
inlineoverridevirtual

check whether we are allowed to upgrade (or already support) to the named feature

Implements WalletStorage.

Definition at line 905 of file wallet.h.

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

◆ chain()

interfaces::Chain& CWallet::chain ( ) const
inline

Interface for accessing chain state.

Definition at line 896 of file wallet.h.

Here is the caller graph for this function:

◆ ComputeTimeSmart()

unsigned int CWallet::ComputeTimeSmart ( const CWalletTx wtx) const

Compute smart timestamp for a transaction being added to the wallet.

Logic:

  • If sending a transaction, assign its timestamp to the current time.
  • If receiving a transaction outside a block, assign its timestamp to the current time.
  • If receiving a block with a future timestamp, assign all its (not already known) transactions' timestamps to the current time.
  • If receiving a block with a past timestamp, before the most recent known transaction (that we care about), assign all its (not already known) transactions' timestamps to the same timestamp as that most-recent-known transaction.
  • If receiving a block with a past timestamp, but after the most recent known transaction, assign all its (not already known) transactions' timestamps to the block time.

For more information see CWalletTx::nTimeSmart, https://bitcointalk.org/?topic=54527, or https://github.com/bitcoin/bitcoin/pull/1393.

Definition at line 4014 of file wallet.cpp.

Here is the call graph for this function:

◆ ConnectScriptPubKeyManNotifiers()

void CWallet::ConnectScriptPubKeyManNotifiers ( )

Connect the signals from ScriptPubKeyMans to the signals in CWallet.

Definition at line 4868 of file wallet.cpp.

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

◆ CreateWalletFromFile()

std::shared_ptr< CWallet > CWallet::CreateWalletFromFile ( const CChainParams chainParams,
interfaces::Chain chain,
const WalletLocation location,
bilingual_str error,
std::vector< bilingual_str > &  warnings,
uint64_t  wallet_creation_flags = 0 
)
static

Initializes the wallet, returns a new CWallet instance or a null pointer in case of an error.

Definition at line 4162 of file wallet.cpp.

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

◆ DummySignTx()

bool CWallet::DummySignTx ( CMutableTransaction txNew,
const std::set< CTxOut > &  txouts,
bool  use_max_sig = false 
) const
inline

Definition at line 1177 of file wallet.h.

Here is the caller graph for this function:

◆ EraseDestData()

bool CWallet::EraseDestData ( WalletBatch batch,
const CTxDestination dest,
const std::string &  key 
)

Erases a destination data tuple in the store and on disk.

Definition at line 4066 of file wallet.cpp.

Here is the call graph for this function:

◆ FindAddressBookEntry()

const CAddressBookData * CWallet::FindAddressBookEntry ( const CTxDestination dest,
bool  allow_change = false 
) const

Definition at line 4531 of file wallet.cpp.

Here is the caller graph for this function:

◆ GetActiveScriptPubKeyMans()

std::set< ScriptPubKeyMan * > CWallet::GetActiveScriptPubKeyMans ( ) const

Returns all unique ScriptPubKeyMans in m_internal_spk_managers and m_external_spk_managers.

Definition at line 4744 of file wallet.cpp.

◆ GetAllScriptPubKeyMans()

std::set< ScriptPubKeyMan * > CWallet::GetAllScriptPubKeyMans ( ) const

Returns all unique ScriptPubKeyMans.

Definition at line 4757 of file wallet.cpp.

◆ GetBroadcastTransactions()

bool CWallet::GetBroadcastTransactions ( ) const
inline

Inquire whether this wallet broadcasts transactions.

Definition at line 1353 of file wallet.h.

◆ GetDatabase()

WalletDatabase& CWallet::GetDatabase ( )
inlineoverridevirtual

Implements WalletStorage.

Definition at line 829 of file wallet.h.

◆ GetDBHandle()

WalletDatabase& CWallet::GetDBHandle ( )
inline

Get database handle used by this wallet.

Ideally this function would not be necessary.

Definition at line 828 of file wallet.h.

◆ GetDescriptorScriptPubKeyMan()

DescriptorScriptPubKeyMan * CWallet::GetDescriptorScriptPubKeyMan ( const WalletDescriptor desc) const

Return the DescriptorScriptPubKeyMan for a WalletDescriptor if it is already in the wallet.

Definition at line 4954 of file wallet.cpp.

Here is the call graph for this function:

◆ GetDestData()

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 4080 of file wallet.cpp.

◆ GetDestValues()

std::vector< std::string > CWallet::GetDestValues ( const std::string &  prefix) const

Get all destination values matching a prefix.

Definition at line 4099 of file wallet.cpp.

◆ GetDisplayName()

const std::string CWallet::GetDisplayName ( ) const
inlineoverridevirtual

Returns a bracketed wallet name for displaying in logs, will return [default wallet] if the wallet has no name.

Implements WalletStorage.

Definition at line 1440 of file wallet.h.

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

◆ GetEncryptionKey()

const CKeyingMaterial & CWallet::GetEncryptionKey ( ) const
overridevirtual

Implements WalletStorage.

Definition at line 4860 of file wallet.cpp.

◆ GetKeyBirthTimes()

void CWallet::GetKeyBirthTimes ( std::map< CKeyID, int64_t > &  mapKeyBirth) const

Definition at line 3926 of file wallet.cpp.

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

◆ GetLastBlockHash()

BlockHash CWallet::GetLastBlockHash ( ) const
inline

Definition at line 1512 of file wallet.h.

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

◆ GetLastBlockHeight()

int CWallet::GetLastBlockHeight ( ) const
inline

Get last block processed height.

Definition at line 1507 of file wallet.h.

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

◆ GetLegacyScriptPubKeyMan()

LegacyScriptPubKeyMan * CWallet::GetLegacyScriptPubKeyMan ( ) const

Get the LegacyScriptPubKeyMan which is used for all types, internal, and external.

Definition at line 4826 of file wallet.cpp.

Here is the caller graph for this function:

◆ GetLocation()

const WalletLocation& CWallet::GetLocation ( ) const
inline

Definition at line 843 of file wallet.h.

◆ GetName()

const std::string& CWallet::GetName ( ) const
inline

Get a name for this wallet for logging/debugging purposes.

Definition at line 848 of file wallet.h.

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

◆ GetOrCreateLegacyScriptPubKeyMan()

LegacyScriptPubKeyMan * CWallet::GetOrCreateLegacyScriptPubKeyMan ( )

Definition at line 4840 of file wallet.cpp.

Here is the caller graph for this function:

◆ GetScriptPubKeyMan() [1/3]

ScriptPubKeyMan * CWallet::GetScriptPubKeyMan ( const OutputType type,
bool  internal 
) const

Get the ScriptPubKeyMan for the given OutputType and internal/external chain.

Definition at line 4765 of file wallet.cpp.

Here is the caller graph for this function:

◆ GetScriptPubKeyMan() [2/3]

ScriptPubKeyMan * CWallet::GetScriptPubKeyMan ( const CScript script) const

Get the ScriptPubKeyMan for a script.

Definition at line 4792 of file wallet.cpp.

◆ GetScriptPubKeyMan() [3/3]

ScriptPubKeyMan * CWallet::GetScriptPubKeyMan ( const uint256 id) const

Get the ScriptPubKeyMan by id.

Definition at line 4802 of file wallet.cpp.

◆ GetScriptPubKeyMans()

std::set< ScriptPubKeyMan * > CWallet::GetScriptPubKeyMans ( const CScript script,
SignatureData sigdata 
) const

Get all of the ScriptPubKeyMans for a script given additional information in sigdata (populated by e.g.

a psbt)

Definition at line 4781 of file wallet.cpp.

◆ GetSolvingProvider() [1/2]

std::unique_ptr< SigningProvider > CWallet::GetSolvingProvider ( const CScript script) const

Get the SigningProvider for a script.

Definition at line 4810 of file wallet.cpp.

Here is the caller graph for this function:

◆ GetSolvingProvider() [2/2]

std::unique_ptr< SigningProvider > CWallet::GetSolvingProvider ( const CScript script,
SignatureData sigdata 
) const

Definition at line 4816 of file wallet.cpp.

◆ GetVersion()

int CWallet::GetVersion ( ) const
inline

get the current wallet format (the oldest client version guaranteed to understand this wallet)

Definition at line 1298 of file wallet.h.

Here is the caller graph for this function:

◆ GroupOutputs()

std::vector< OutputGroup > CWallet::GroupOutputs ( const std::vector< COutput > &  outputs,
bool  single_coin,
const size_t  max_ancestors 
) const

Definition at line 4643 of file wallet.cpp.

Here is the call graph for this function:

◆ GUARDED_BY() [1/11]

CKeyingMaterial vMasterKey CWallet::GUARDED_BY ( cs_wallet  )
private

◆ GUARDED_BY() [2/11]

int nWalletVersion CWallet::GUARDED_BY ( cs_wallet  )
private

the current wallet version: clients below this version are not able to load the wallet

◆ GUARDED_BY() [3/11]

int nWalletMaxVersion CWallet::GUARDED_BY ( cs_wallet  )
private

the maximum wallet format version: memory-only variable that specifies to what version this wallet may be upgraded

◆ GUARDED_BY() [4/11]

TxSpends mapTxSpends CWallet::GUARDED_BY ( cs_wallet  )
private

◆ GUARDED_BY() [5/11]

BlockHash m_last_block_processed CWallet::GUARDED_BY ( cs_wallet  )
private

The following is used to keep track of how far behind the wallet is from the chain sync, and to allow clients to block on us being caught up.

Processed hash is a pointer on node's tip and doesn't imply that the wallet has scanned sequentially all blocks up to this one.

◆ GUARDED_BY() [6/11]

int m_last_block_processed_height CWallet::GUARDED_BY ( cs_wallet  )
private

◆ GUARDED_BY() [7/11]

std::map<TxId, CWalletTx> mapWallet CWallet::GUARDED_BY ( cs_wallet  )

◆ GUARDED_BY() [8/11]

int64_t nOrderPosNext CWallet::GUARDED_BY ( cs_wallet  )
pure virtual

◆ GUARDED_BY() [9/11]

std::map<CTxDestination, CAddressBookData> m_address_book CWallet::GUARDED_BY ( cs_wallet  )

◆ GUARDED_BY() [10/11]

std::set<COutPoint> setLockedCoins CWallet::GUARDED_BY ( cs_wallet  )

◆ GUARDED_BY() [11/11]

int64_t nRelockTime CWallet::GUARDED_BY ( cs_wallet  )
inline

Holds a timestamp at which point the wallet is scheduled (externally) to be relocked.

Caller must arrange for actual relocking to occur via Lock().

Definition at line 1025 of file wallet.h.

◆ HasEncryptionKeys()

bool CWallet::HasEncryptionKeys ( ) const
overridevirtual

Implements WalletStorage.

Definition at line 4864 of file wallet.cpp.

◆ HaveChain()

bool CWallet::HaveChain ( ) const
inline

Interface to assert chain access.

Definition at line 873 of file wallet.h.

◆ IsAbortingRescan()

bool CWallet::IsAbortingRescan ( ) const
inline

Definition at line 977 of file wallet.h.

Here is the caller graph for this function:

◆ IsCrypted()

bool CWallet::IsCrypted ( ) const

Definition at line 4703 of file wallet.cpp.

Here is the caller graph for this function:

◆ IsLegacy()

bool CWallet::IsLegacy ( ) const

Determine if we are a legacy wallet.

Definition at line 4944 of file wallet.cpp.

Here is the caller graph for this function:

◆ IsLocked()

bool CWallet::IsLocked ( ) const
overridevirtual

Implements WalletStorage.

Definition at line 4707 of file wallet.cpp.

Here is the caller graph for this function:

◆ IsScanning()

bool CWallet::IsScanning ( ) const
inline

Definition at line 978 of file wallet.h.

Here is the caller graph for this function:

◆ LoadDescriptorScriptPubKeyMan()

void CWallet::LoadDescriptorScriptPubKeyMan ( uint256  id,
WalletDescriptor desc 
)

Instantiate a descriptor ScriptPubKeyMan from the WalletDescriptor and load it.

Definition at line 4876 of file wallet.cpp.

◆ LoadDestData()

void 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 4075 of file wallet.cpp.

◆ LoadMinVersion()

bool CWallet::LoadMinVersion ( int  nVersion)
inline

Definition at line 990 of file wallet.h.

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

◆ Lock()

bool CWallet::Lock ( )

Definition at line 4715 of file wallet.cpp.

Here is the caller graph for this function:

◆ postInitProcess()

void CWallet::postInitProcess ( )

Wallet post-init setup Gives the wallet a chance to register repetitive tasks and complete post-init tasks.

Definition at line 4587 of file wallet.cpp.

◆ ScanningDuration()

int64_t CWallet::ScanningDuration ( ) const
inline

Definition at line 979 of file wallet.h.

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

◆ ScanningProgress()

double CWallet::ScanningProgress ( ) const
inline

Definition at line 982 of file wallet.h.

Here is the caller graph for this function:

◆ SetActiveScriptPubKeyMan()

void CWallet::SetActiveScriptPubKeyMan ( uint256  id,
OutputType  type,
bool  internal,
bool  memonly = false 
)

Sets the active ScriptPubKeyMan for the specified type and internal.

Parameters
[in]idThe unique id for the ScriptPubKeyMan
[in]typeThe OutputType this ScriptPubKeyMan provides addresses for
[in]internalWhether this ScriptPubKeyMan provides change addresses
[in]memonlyWhether to record this update to the database. Set to true for wallet loading, normally false when actually updating the wallet.

Definition at line 4921 of file wallet.cpp.

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

◆ SetBroadcastTransactions()

void CWallet::SetBroadcastTransactions ( bool  broadcast)
inline

Set whether this wallet broadcasts transactions.

Definition at line 1355 of file wallet.h.

◆ SetLastBlockProcessed()

void CWallet::SetLastBlockProcessed ( int  block_height,
BlockHash  block_hash 
)
inline

Set last block processed height, currently only use in unit test.

Definition at line 1518 of file wallet.h.

Here is the call graph for this function:

◆ SetupDescriptorScriptPubKeyMans()

void CWallet::SetupDescriptorScriptPubKeyMans ( )

Create new DescriptorScriptPubKeyMans and add them to the wallet.

Definition at line 4883 of file wallet.cpp.

Here is the call graph for this function:

◆ SetupLegacyScriptPubKeyMan()

void CWallet::SetupLegacyScriptPubKeyMan ( )

Make a LegacyScriptPubKeyMan and set it for all types, internal, and external.

Definition at line 4845 of file wallet.cpp.

Here is the caller graph for this function:

◆ Unlock()

bool CWallet::Unlock ( const CKeyingMaterial vMasterKeyIn,
bool  accept_no_keys = false 
)
private

Definition at line 4729 of file wallet.cpp.

Here is the caller graph for this function:

◆ UpgradeWallet()

bool CWallet::UpgradeWallet ( int  version,
bilingual_str error,
std::vector< bilingual_str > &  warnings 
)

Upgrade the wallet.

Definition at line 4543 of file wallet.cpp.

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

◆ Verify()

bool CWallet::Verify ( const CChainParams chainParams,
interfaces::Chain chain,
const WalletLocation location,
bilingual_str error_string,
std::vector< bilingual_str > &  warnings 
)
static

Verify wallet naming and perform salvage on the wallet if required.

Definition at line 4111 of file wallet.cpp.

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

◆ WalletLogPrintf()

template<typename... Params>
void CWallet::WalletLogPrintf ( std::string  fmt,
Params...  parameters 
) const
inline

Prepends the wallet name in logging output to ease debugging in multi-wallet use cases.

Definition at line 1451 of file wallet.h.

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

◆ WalletLogPrintfToBeContinued()

template<typename... Params>
void CWallet::WalletLogPrintfToBeContinued ( std::string  fmt,
Params...  parameters 
) const
inline

Definition at line 1456 of file wallet.h.

Friends And Related Function Documentation

◆ WalletRescanReserver

friend class WalletRescanReserver
friend

Definition at line 692 of file wallet.h.

Member Data Documentation

◆ cs_wallet [1/2]

RecursiveMutex CWallet::cs_wallet
mutable

Definition at line 822 of file wallet.h.

◆ cs_wallet [2/2]

void CWallet::cs_wallet

Definition at line 1410 of file wallet.h.

◆ database

std::unique_ptr<WalletDatabase> CWallet::database
private

Internal database handle.

Definition at line 785 of file wallet.h.

◆ fAbortRescan

std::atomic<bool> CWallet::fAbortRescan {false}
private

Definition at line 687 of file wallet.h.

◆ fBroadcastTransactions

bool CWallet::fBroadcastTransactions = false
private

Definition at line 703 of file wallet.h.

◆ fScanningWallet

std::atomic<bool> CWallet::fScanningWallet {false}
private

Definition at line 689 of file wallet.h.

◆ m_allow_fallback_fee

bool CWallet::m_allow_fallback_fee {true}

will be false if -fallbackfee=0

Definition at line 1209 of file wallet.h.

◆ m_best_block_time

std::atomic<int64_t> CWallet::m_best_block_time {0}
private

Definition at line 706 of file wallet.h.

◆ m_chain

interfaces::Chain* CWallet::m_chain
private

Interface for accessing chain state.

Definition at line 777 of file wallet.h.

◆ m_chain_notifications_handler

std::unique_ptr<interfaces::Handler> CWallet::m_chain_notifications_handler

Registered interfaces::Chain::Notifications handler.

Definition at line 893 of file wallet.h.

◆ m_default_address_type

OutputType CWallet::m_default_address_type {DEFAULT_ADDRESS_TYPE}

Definition at line 1220 of file wallet.h.

◆ m_default_change_type

OutputType CWallet::m_default_change_type {DEFAULT_CHANGE_TYPE}

Definition at line 1221 of file wallet.h.

◆ m_default_max_tx_fee

Amount CWallet::m_default_max_tx_fee {DEFAULT_TRANSACTION_MAXFEE}

Absolute maximum transaction fee (in satoshis) used by default for the wallet.

Definition at line 1226 of file wallet.h.

◆ m_external_spk_managers

std::map<OutputType, ScriptPubKeyMan *> CWallet::m_external_spk_managers
private

Definition at line 809 of file wallet.h.

◆ m_fallback_fee

CFeeRate CWallet::m_fallback_fee {DEFAULT_FALLBACK_FEE}

If fee estimation does not have enough data to provide estimates, use this fee instead.

Has no effect if not using fee estimation Override with -fallbackfee

Definition at line 1217 of file wallet.h.

◆ m_internal_spk_managers

std::map<OutputType, ScriptPubKeyMan *> CWallet::m_internal_spk_managers
private

Definition at line 810 of file wallet.h.

◆ m_location

WalletLocation CWallet::m_location
private

Wallet location which includes wallet name (see WalletLocation).

Definition at line 782 of file wallet.h.

◆ m_max_aps_fee

Amount CWallet::m_max_aps_fee {DEFAULT_MAX_AVOIDPARTIALSPEND_FEE}

note: this is absolute fee, not fee rate

Definition at line 1219 of file wallet.h.

◆ m_min_fee

Definition at line 1211 of file wallet.h.

◆ m_pay_tx_fee

CFeeRate CWallet::m_pay_tx_fee {DEFAULT_PAY_TX_FEE}

Definition at line 1206 of file wallet.h.

◆ m_scanning_progress

std::atomic<double> CWallet::m_scanning_progress {0}
private

Definition at line 691 of file wallet.h.

◆ m_scanning_start

std::atomic<int64_t> CWallet::m_scanning_start {0}
private

Definition at line 690 of file wallet.h.

◆ m_spend_zero_conf_change

bool CWallet::m_spend_zero_conf_change {DEFAULT_SPEND_ZEROCONF_CHANGE}

Definition at line 1207 of file wallet.h.

◆ m_spk_managers

std::map<uint256, std::unique_ptr<ScriptPubKeyMan> > CWallet::m_spk_managers
private

Definition at line 815 of file wallet.h.

◆ m_unlock_mutex

Mutex CWallet::m_unlock_mutex

Definition at line 1025 of file wallet.h.

◆ m_wallet_flags

std::atomic<uint64_t> CWallet::m_wallet_flags {0}
private

Definition at line 764 of file wallet.h.

◆ mapMasterKeys

MasterKeyMap CWallet::mapMasterKeys

Definition at line 851 of file wallet.h.

◆ nAccountingEntryNumber

uint64_t CWallet::nAccountingEntryNumber = 0

Definition at line 881 of file wallet.h.

◆ nMasterKeyMaxID

unsigned int CWallet::nMasterKeyMaxID = 0

Definition at line 852 of file wallet.h.

◆ nNextResend

int64_t CWallet::nNextResend = 0
private

Definition at line 702 of file wallet.h.

◆ NotifyAddressBookChanged

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.

Note
called with lock cs_wallet held.

Definition at line 1326 of file wallet.h.

◆ NotifyCanGetAddressesChanged

boost::signals2::signal<void()> CWallet::NotifyCanGetAddressesChanged

Keypool has new keys.

Definition at line 1344 of file wallet.h.

◆ NotifyStatusChanged

boost::signals2::signal<void(CWallet *wallet)> CWallet::NotifyStatusChanged

Wallet status (encrypted, locked) changed.

Note: Called without locks held.

Definition at line 1350 of file wallet.h.

◆ NotifyTransactionChanged

boost::signals2::signal<void(CWallet *wallet, const TxId &txid, ChangeType status)> CWallet::NotifyTransactionChanged

Wallet transaction added, removed or updated.

Note
called with lock cs_wallet held.

Definition at line 1334 of file wallet.h.

◆ NotifyUnload

boost::signals2::signal<void()> CWallet::NotifyUnload

Wallet is about to be unloaded.

Definition at line 1317 of file wallet.h.

◆ NotifyWatchonlyChanged

boost::signals2::signal<void(bool fHaveWatchOnly)> CWallet::NotifyWatchonlyChanged

Watch-only address added.

Definition at line 1341 of file wallet.h.

◆ ShowProgress

boost::signals2::signal<void(const std::string &title, int nProgress)> CWallet::ShowProgress

Show progress e.g.

for rescan

Definition at line 1338 of file wallet.h.

◆ wtxOrdered

TxItems CWallet::wtxOrdered

Definition at line 878 of file wallet.h.


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