[#wallet-CWallet] = xref:wallet.adoc[wallet]::CWallet :relfileprefix: ../ :mrdocs: A CWallet maintains a set of transactions and balances, and provides the ability to create new transactions. == Synopsis Declared in `<wallet/wallet.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- class CWallet final : public xref:wallet/WalletStorage.adoc[WalletStorage] , public xref:interfaces/Chain.adoc[interfaces::Chain::Notifications] ---- == Base Classes [cols="1,4"] |=== | Name| Description | `xref:wallet/WalletStorage.adoc[WalletStorage]` | Wallet storage things that ScriptPubKeyMans need in order to be able to store things to the wallet database. It provides access to things that are part of the entire wallet and not specific to a ScriptPubKeyMan such as wallet flags, wallet version, encryption keys, encryption status, and the database itself. This allows a ScriptPubKeyMan to have callbacks into CWallet without causing a circular dependency. WalletStorage should be the same for all ScriptPubKeyMans of a wallet. | `xref:interfaces/Chain.adoc[interfaces::Chain::Notifications]` | |=== == Types [cols="1,4"] |=== | Name| Description | xref:wallet/CWallet/AddrBookFilter.adoc[`AddrBookFilter`] | Filter struct for 'ListAddrBookAddresses' | xref:wallet/CWallet/ScanResult.adoc[`ScanResult`] | Outcome of scanning a range of blocks for wallet transactions. |=== == Type Aliases [cols="1,4"] |=== | Name| Description | xref:wallet/CWallet/HDPubKeyMap.adoc[`HDPubKeyMap`] | Maps a descriptor xpub to the descriptor managers that use it. | xref:wallet/CWallet/ListAddrBookFunc.adoc[`ListAddrBookFunc`] | Walk‐through the address book entries. Stops when the provided 'ListAddrBookFunc' returns false. | xref:wallet/CWallet/MasterKeyMap.adoc[`MasterKeyMap`] | Maps a master key id to its encrypted master key. | xref:wallet/CWallet/TxItems.adoc[`TxItems`] | Maps a transaction's order position to its wallet transaction. | xref:wallet/CWallet/UpdateWalletTxFn.adoc[`UpdateWalletTxFn`] | Callback for updating transaction metadata in mapWallet. |=== == Enums [cols="1,4"] |=== | Name| Description | xref:wallet/CWallet/HDKeyFilter.adoc[`HDKeyFilter`] | Which descriptors GetHDPubKeys() should consider. | xref:wallet/CWallet/SpendType.adoc[`SpendType`] | Describes how far along the spend of an output is. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:wallet/CWallet/2constructor.adoc[`CWallet`] [.small]#[constructor]# | Construct wallet with specified name and database implementation. | xref:wallet/CWallet/2destructor.adoc[`~CWallet`] [.small]#[destructor]# [.small]#[virtual]# | Destroy the wallet; asserts no unload slots remain connected. | xref:wallet/CWallet/AbandonTransaction-06.adoc[`AbandonTransaction`] | `AbandonTransaction` overloads | xref:wallet/CWallet/AbortRescan.adoc[`AbortRescan`] | Request that any in‐progress rescan abort. | xref:wallet/CWallet/AddActiveScriptPubKeyMan.adoc[`AddActiveScriptPubKeyMan`] | Adds the active ScriptPubKeyMan for the specified type and internal. Writes it to the wallet file | xref:wallet/CWallet/AddToWallet.adoc[`AddToWallet`] | Add the transaction to the wallet, wrapping it up inside a CWalletTx | xref:wallet/CWallet/AddWalletDescriptor.adoc[`AddWalletDescriptor`] | Add a descriptor to the wallet, return a ScriptPubKeyMan & associated output type | xref:wallet/CWallet/ApplyMigrationData.adoc[`ApplyMigrationData`] | Adds the ScriptPubKeyMans from MigrationData to this wallet, removes the LegacyDataSPKM, and moves transaction and address book entries to watchonly_wallet or solvable_wallet as needed. | xref:wallet/CWallet/BackupWallet.adoc[`BackupWallet`] | Copy the wallet database file to a backup path. | xref:wallet/CWallet/BlockUntilSyncedToCurrentChain.adoc[`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 | xref:wallet/CWallet/CacheNewScriptPubKeys.adoc[`CacheNewScriptPubKeys`] | Add scriptPubKeys for this ScriptPubKeyMan into the scriptPubKey cache | xref:wallet/CWallet/CanGetAddresses.adoc[`CanGetAddresses`] | Returns true if the wallet can give out new addresses. This means it has keys in the keypool or can generate new keys | xref:wallet/CWallet/CanGrindR.adoc[`CanGrindR`] | Whether the (external) signer performs R‐value signature grinding | xref:wallet/CWallet/ChangeWalletPassphrase.adoc[`ChangeWalletPassphrase`] | Change the wallet's encryption passphrase. | xref:wallet/CWallet/Close.adoc[`Close`] | Close wallet database | xref:wallet/CWallet/CommitTransaction.adoc[`CommitTransaction`] | Submit the transaction to the node's mempool and then relay to peers. Should be called after CreateTransaction unless you want to abort broadcasting the transaction. | xref:wallet/CWallet/ComputeTimeSmart.adoc[`ComputeTimeSmart`] | Estimate a smart timestamp for a transaction from block and receive times. | xref:wallet/CWallet/ConnectScriptPubKeyManNotifiers.adoc[`ConnectScriptPubKeyManNotifiers`] | Connect the signals from ScriptPubKeyMans to the signals in CWallet | xref:wallet/CWallet/DeactivateScriptPubKeyMan.adoc[`DeactivateScriptPubKeyMan`] | Remove specified ScriptPubKeyMan from set of active SPK managers. Writes the change to the wallet file. | xref:wallet/CWallet/DelAddressBook.adoc[`DelAddressBook`] | Remove a destination from the address book. | xref:wallet/CWallet/DelAddressBookWithDB.adoc[`DelAddressBookWithDB`] | Remove a destination from the address book within a database batch. | xref:wallet/CWallet/DisconnectChainNotifications.adoc[`DisconnectChainNotifications`] | Disconnect chain notifications and wait for all notifications to be processed | xref:wallet/CWallet/DisplayAddress.adoc[`DisplayAddress`] | Display address on an external signer. | xref:wallet/CWallet/DisplayName.adoc[`DisplayName`] | Return wallet name for display, like LogName() but translates "default wallet" string. | xref:wallet/CWallet/EncryptWallet.adoc[`EncryptWallet`] | Encrypt an unencrypted wallet with the given passphrase. | xref:wallet/CWallet/EraseAddressReceiveRequest.adoc[`EraseAddressReceiveRequest`] | Erase a stored receive request for a destination. | xref:wallet/CWallet/FillPSBT.adoc[`FillPSBT`] | Fills out a PSBT with information from the wallet. Fills in UTXOs if we have them. Tries to sign if options.sign=true. Sets `complete` if the PSBT is now complete (i.e. has all required signatures or signature‐parts, and is ready to finalize.) | xref:wallet/CWallet/FindAddressBookEntry.adoc[`FindAddressBookEntry`] | Look up an address book entry for a destination. | xref:wallet/CWallet/ForEachAddrBookEntry.adoc[`ForEachAddrBookEntry`] | Invoke a callback for each address book entry until it returns false. | xref:wallet/CWallet/GetActiveScriptPubKeyMans.adoc[`GetActiveScriptPubKeyMans`] | Returns all unique ScriptPubKeyMans in m_internal_spk_managers and m_external_spk_managers | xref:wallet/CWallet/GetAddressReceiveRequests.adoc[`GetAddressReceiveRequests`] | Return the identifiers of all stored receive requests. | xref:wallet/CWallet/GetAllScriptPubKeyMans.adoc[`GetAllScriptPubKeyMans`] | Returns all unique ScriptPubKeyMans | xref:wallet/CWallet/GetBirthTime.adoc[`GetBirthTime`] | Returns the time of the first created key or, in case of an import, it could be the time of the first received transaction | xref:wallet/CWallet/GetBroadcastTransactions.adoc[`GetBroadcastTransactions`] | Inquire whether this wallet broadcasts transactions. | xref:wallet/CWallet/GetConflicts.adoc[`GetConflicts`] | Get wallet transactions that conflict with given transaction (spend same outputs) | xref:wallet/CWallet/GetDatabase.adoc[`GetDatabase`] [.small]#[virtual]# | Access the wallet's database backend. | xref:wallet/CWallet/GetDebit-01.adoc[`GetDebit`] | `GetDebit` overloads | xref:wallet/CWallet/GetDescriptorScriptPubKeyMan.adoc[`GetDescriptorScriptPubKeyMan`] | Return the DescriptorScriptPubKeyMan for a WalletDescriptor if it is already in the wallet | xref:wallet/CWallet/GetDescriptorsForLegacy.adoc[`GetDescriptorsForLegacy`] | Get all of the descriptors from a legacy wallet | xref:wallet/CWallet/GetExtKey.adoc[`GetExtKey`] | Reconstruct the extended private key for an HD xpub. Returns nullopt when no descriptor has the private key, or the wallet is locked. | xref:wallet/CWallet/GetHDPubKeys.adoc[`GetHDPubKeys`] | Retrieve descriptor xpubs matching the requested filter. | xref:wallet/CWallet/GetKey.adoc[`GetKey`] | Find the private key for the given key id from the wallet's descriptors, if available Returns nullopt when no descriptor has the key or if the wallet is locked. | xref:wallet/CWallet/GetKeyPoolSize.adoc[`GetKeyPoolSize`] | Count the keys currently available in the keypool. | xref:wallet/CWallet/GetLastBlockHash.adoc[`GetLastBlockHash`] | Get the hash of the last block processed by the wallet. | xref:wallet/CWallet/GetLastBlockHeight.adoc[`GetLastBlockHeight`] | Get last block processed height | xref:wallet/CWallet/GetLegacyDataSPKM.adoc[`GetLegacyDataSPKM`] | Get the LegacyDataSPKM used for all legacy output types and both internal and external chains. | xref:wallet/CWallet/GetName.adoc[`GetName`] | Get a name for this wallet for logging/debugging purposes. | xref:wallet/CWallet/GetNewChangeDestination.adoc[`GetNewChangeDestination`] | Generate a new change destination of the given type. | xref:wallet/CWallet/GetNewDestination.adoc[`GetNewDestination`] | Generate a new receiving destination of the given type. | xref:wallet/CWallet/GetOrCreateLegacyDataSPKM.adoc[`GetOrCreateLegacyDataSPKM`] | Return the legacy data ScriptPubKeyMan, creating it if it does not exist. | xref:wallet/CWallet/GetScriptPubKeyMan-0f.adoc[`GetScriptPubKeyMan`] | `GetScriptPubKeyMan` overloads | xref:wallet/CWallet/GetScriptPubKeyMans.adoc[`GetScriptPubKeyMans`] | Get all the ScriptPubKeyMans for a script | xref:wallet/CWallet/GetSolvingProvider-054.adoc[`GetSolvingProvider`] | `GetSolvingProvider` overloads | xref:wallet/CWallet/GetTXO.adoc[`GetTXO`] | Look up a single wallet output by outpoint. | xref:wallet/CWallet/GetTXOs.adoc[`GetTXOs`] | Access the cache of transaction outputs owned by this wallet. | xref:wallet/CWallet/GetTxBlocksToMaturity.adoc[`GetTxBlocksToMaturity`] | Return the number of blocks until a coinbase transaction matures. | xref:wallet/CWallet/GetTxConflicts.adoc[`GetTxConflicts`] | Find wallet transactions that conflict with the given transaction. | xref:wallet/CWallet/GetTxDepthInMainChain.adoc[`GetTxDepthInMainChain`] | Return depth of transaction in blockchain: <0 : conflicts with a transaction this deep in the blockchain 0 : in memory pool, waiting to be included in a block >=1 : this many blocks deep in the main chain | xref:wallet/CWallet/GetWalletDescriptors.adoc[`GetWalletDescriptors`] | Get the wallet descriptors for a script. | xref:wallet/CWallet/GetWalletFlags.adoc[`GetWalletFlags`] | Retrieve all of the wallet's flags | xref:wallet/CWallet/GetWalletTx.adoc[`GetWalletTx`] | Look up a wallet transaction by its txid. | xref:wallet/CWallet/HasEncryptionKeys.adoc[`HasEncryptionKeys`] [.small]#[virtual]# | Report whether the wallet holds any encryption keys. | xref:wallet/CWallet/HasWalletSpend.adoc[`HasWalletSpend`] | Check if a given transaction has any of its outputs spent by another transaction in the wallet | xref:wallet/CWallet/HaveChain.adoc[`HaveChain`] | Interface to assert chain access | xref:wallet/CWallet/HaveCryptedKeys.adoc[`HaveCryptedKeys`] | Report whether the wallet holds any encrypted private keys. | xref:wallet/CWallet/HowSpent.adoc[`HowSpent`] | Determine how an output has been spent. | xref:wallet/CWallet/IncOrderPosNext.adoc[`IncOrderPosNext`] | Increment the next transaction order id | xref:wallet/CWallet/InitWalletFlags.adoc[`InitWalletFlags`] | overwrite all flags by the given uint64_t flags must be uninitialised (or 0) only known flags may be present | xref:wallet/CWallet/IsAbortingRescan.adoc[`IsAbortingRescan`] | Report whether a rescan abort has been requested. | xref:wallet/CWallet/IsActiveScriptPubKeyMan.adoc[`IsActiveScriptPubKeyMan`] | Report whether a ScriptPubKeyMan is one of the wallet's active managers. | xref:wallet/CWallet/IsAddressPreviouslySpent.adoc[`IsAddressPreviouslySpent`] | Report whether a destination has been marked as previously spent. | xref:wallet/CWallet/IsFromMe.adoc[`IsFromMe`] | should probably be renamed to IsRelevantToMe | xref:wallet/CWallet/IsHDEnabled.adoc[`IsHDEnabled`] | Returns true if HD is enabled | xref:wallet/CWallet/IsInternalScriptPubKeyMan.adoc[`IsInternalScriptPubKeyMan`] | Returns whether the provided ScriptPubKeyMan is internal | xref:wallet/CWallet/IsLocked.adoc[`IsLocked`] [.small]#[virtual]# | Report whether the wallet's keys are currently locked (encrypted and unavailable). | xref:wallet/CWallet/IsLockedCoin.adoc[`IsLockedCoin`] | Report whether an output is locked against spending. | xref:wallet/CWallet/IsMine-08c.adoc[`IsMine`] | `IsMine` overloads | xref:wallet/CWallet/IsScanning.adoc[`IsScanning`] | Report whether a rescan is running. | xref:wallet/CWallet/IsScanningWithPassphrase.adoc[`IsScanningWithPassphrase`] | Report whether the running rescan holds the wallet passphrase. | xref:wallet/CWallet/IsSpent.adoc[`IsSpent`] | Report whether an output is spent by any known transaction. | xref:wallet/CWallet/IsSpentKey.adoc[`IsSpentKey`] | Whether this or any known scriptPubKey with the same single key has been spent. | xref:wallet/CWallet/IsTxImmatureCoinBase.adoc[`IsTxImmatureCoinBase`] | Report whether a transaction is an immature coinbase output. | xref:wallet/CWallet/IsWalletFlagSet.adoc[`IsWalletFlagSet`] [.small]#[virtual]# | check if a certain wallet flag is set | xref:wallet/CWallet/KeypoolCountExternalKeys.adoc[`KeypoolCountExternalKeys`] | Count the external (receiving) keys available in the keypool. | xref:wallet/CWallet/ListAddrBookAddresses.adoc[`ListAddrBookAddresses`] | Filter and retrieve destinations stored in the addressbook | xref:wallet/CWallet/ListAddrBookLabels.adoc[`ListAddrBookLabels`] | Retrieve all the known labels in the address book | xref:wallet/CWallet/ListLockedCoins.adoc[`ListLockedCoins`] | List all currently locked outputs. | xref:wallet/CWallet/LoadActiveScriptPubKeyMan.adoc[`LoadActiveScriptPubKeyMan`] | Loads an active ScriptPubKeyMan for the specified type and internal. (used by LoadWallet) | xref:wallet/CWallet/LoadAddressPreviouslySpent.adoc[`LoadAddressPreviouslySpent`] | Marks destination as previously spent. | xref:wallet/CWallet/LoadAddressReceiveRequest.adoc[`LoadAddressReceiveRequest`] | Appends payment request to destination. | xref:wallet/CWallet/LoadDescriptorScriptPubKeyMan.adoc[`LoadDescriptorScriptPubKeyMan`] | Instantiate a descriptor ScriptPubKeyMan from the WalletDescriptor and load it | xref:wallet/CWallet/LoadLockedCoin.adoc[`LoadLockedCoin`] | Load a locked coin from the database into memory. | xref:wallet/CWallet/LoadToWallet.adoc[`LoadToWallet`] | Load a wallet transaction read from the database into memory. | xref:wallet/CWallet/LoadWalletFlags.adoc[`LoadWalletFlags`] | Loads the flags into the wallet. (used by LoadWallet) | xref:wallet/CWallet/Lock.adoc[`Lock`] | Lock the wallet, clearing the decrypted master key from memory. | xref:wallet/CWallet/LockCoin.adoc[`LockCoin`] | Lock an output so it is not selected for spending. | xref:wallet/CWallet/LogName.adoc[`LogName`] [.small]#[virtual]# | Return wallet name for use in logs, will return "default wallet" if the wallet has no name. | xref:wallet/CWallet/LogStats.adoc[`LogStats`] | Write summary statistics about the wallet to the log. | xref:wallet/CWallet/MarkDestinationsDirty.adoc[`MarkDestinationsDirty`] | Marks all outputs in each one of the destinations dirty, so their cache is reset and does not return outdated information. | xref:wallet/CWallet/MarkDirty.adoc[`MarkDirty`] | Mark cached balances dirty so they are recomputed on next access. | xref:wallet/CWallet/MarkReplaced.adoc[`MarkReplaced`] | Mark a transaction as replaced by another transaction. | xref:wallet/CWallet/MaybeUpdateBirthTime.adoc[`MaybeUpdateBirthTime`] | Updates wallet birth time if 'time' is below it | xref:wallet/CWallet/MigrateToSQLite.adoc[`MigrateToSQLite`] | Move all records from the BDB database to a new SQLite database for storage. The original BDB file will be deleted and replaced with a new SQLite file. A backup is not created. May crash if something unexpected happens in the filesystem. | xref:wallet/CWallet/PopulateWalletFromDB.adoc[`PopulateWalletFromDB`] | Load wallet records from the database into memory. | xref:wallet/CWallet/RefreshAllTXOs.adoc[`RefreshAllTXOs`] | Cache outputs that belong to the wallet for all transactions in the wallet | xref:wallet/CWallet/RefreshTXOsFromTx.adoc[`RefreshTXOsFromTx`] | Cache outputs that belong to the wallet from a single transaction | xref:wallet/CWallet/RemoveTxs-079.adoc[`RemoveTxs`] | `RemoveTxs` overloads | xref:wallet/CWallet/ReorderTransactions.adoc[`ReorderTransactions`] | Reassign order positions to all wallet transactions. | xref:wallet/CWallet/RescanFromTime.adoc[`RescanFromTime`] | Rescan the chain for wallet transactions from a given start time. | xref:wallet/CWallet/ResubmitWalletTransactions.adoc[`ResubmitWalletTransactions`] | Resubmit unconfirmed wallet transactions to the mempool and peers. | xref:wallet/CWallet/ScanForWalletTransactions.adoc[`ScanForWalletTransactions`] | Scan a range of blocks for transactions relevant to this wallet. | xref:wallet/CWallet/ScanningDuration.adoc[`ScanningDuration`] | Measure how long the running rescan has been in progress. | xref:wallet/CWallet/ScanningProgress.adoc[`ScanningProgress`] | Report the progress of the running rescan. | xref:wallet/CWallet/SetAddressBook.adoc[`SetAddressBook`] | Set the address book label and purpose for a destination. | xref:wallet/CWallet/SetAddressPreviouslySpent.adoc[`SetAddressPreviouslySpent`] | Record whether a destination has been previously spent. | xref:wallet/CWallet/SetAddressReceiveRequest.adoc[`SetAddressReceiveRequest`] | Store or update a receive request for a destination. | xref:wallet/CWallet/SetBroadcastTransactions.adoc[`SetBroadcastTransactions`] | Set whether this wallet broadcasts transactions. | xref:wallet/CWallet/SetLastBlockProcessed.adoc[`SetLastBlockProcessed`] | Set last block processed height, and write to database | xref:wallet/CWallet/SetNextResend.adoc[`SetNextResend`] | Set the next time this wallet should resend transactions to 12‐36 hours from now, ~1 day on average. | xref:wallet/CWallet/SetSpentKeyState.adoc[`SetSpentKeyState`] | Record whether the key behind a transaction output has been spent. | xref:wallet/CWallet/SetWalletFlag.adoc[`SetWalletFlag`] | set a single wallet flag | xref:wallet/CWallet/SetupDescriptorScriptPubKeyMan.adoc[`SetupDescriptorScriptPubKeyMan`] | Create new DescriptorScriptPubKeyMan and add it to the wallet | xref:wallet/CWallet/SetupDescriptorScriptPubKeyMans-05.adoc[`SetupDescriptorScriptPubKeyMans`] | `SetupDescriptorScriptPubKeyMans` overloads | xref:wallet/CWallet/SetupLegacyDataSPKM.adoc[`SetupLegacyDataSPKM`] | Create a LegacyDataSPKM and set it for all legacy output types and both internal and external chains. | xref:wallet/CWallet/SetupOwnDescriptorScriptPubKeyMans.adoc[`SetupOwnDescriptorScriptPubKeyMans`] | Create new seed and default DescriptorScriptPubKeyMans for this wallet | xref:wallet/CWallet/SetupWalletGeneration.adoc[`SetupWalletGeneration`] | Setup new descriptors or seed for new address generation | xref:wallet/CWallet/ShouldResend.adoc[`ShouldResend`] | Return true if all conditions for periodically resending transactions are met. | xref:wallet/CWallet/SignMessage.adoc[`SignMessage`] | Sign an arbitrary message with the key for a public key hash. | xref:wallet/CWallet/SignTransaction-06.adoc[`SignTransaction`] | `SignTransaction` overloads | xref:wallet/CWallet/SubmitTxMemoryPoolAndRelay.adoc[`SubmitTxMemoryPoolAndRelay`] | Pass this transaction to node for optional mempool insertion and relay to peers. | xref:wallet/CWallet/TopUpCallback-0a.adoc[`TopUpCallback`] | `TopUpCallback` overloads | xref:wallet/CWallet/TopUpKeyPool.adoc[`TopUpKeyPool`] | Refill the keypool up to the target size. | xref:wallet/CWallet/TransactionCanBeAbandoned.adoc[`TransactionCanBeAbandoned`] | Return whether transaction can be abandoned | xref:wallet/CWallet/TransactionChangeType.adoc[`TransactionChangeType`] | Choose the change output type for a transaction. | xref:wallet/CWallet/Unlock.adoc[`Unlock`] | Unlock the wallet using the given passphrase. | xref:wallet/CWallet/UnlockAllCoins.adoc[`UnlockAllCoins`] | Unlock every locked output. | xref:wallet/CWallet/UnlockCoin.adoc[`UnlockCoin`] | Unlock a previously locked output. | xref:wallet/WalletStorage/UnsetBlankWalletFlag.adoc[`UnsetBlankWalletFlag`] [.small]#[virtual]# | Clears the "blank wallet" flag, recording the change in the given batch. | xref:wallet/CWallet/UnsetWalletFlag.adoc[`UnsetWalletFlag`] | Unsets a single wallet flag | xref:wallet/CWallet/UpgradeDescriptorCache.adoc[`UpgradeDescriptorCache`] | Upgrade DescriptorCaches | xref:wallet/CWallet/WalletLogPrintf.adoc[`WalletLogPrintf`] | Prepends the wallet name in logging output to ease debugging in multi‐wallet use cases | xref:wallet/CWallet/WithEncryptionKey.adoc[`WithEncryptionKey`] [.small]#[virtual]# | Invoke a callback with the decrypted master key while holding the encryption lock. | xref:wallet/CWallet/WriteBestBlock.adoc[`WriteBestBlock`] | Write the current best block to database | xref:wallet/CWallet/blockConnected-0b.adoc[`blockConnected`] | Handle a block being connected to the chain tip. | xref:wallet/CWallet/blockDisconnected-0a.adoc[`blockDisconnected`] | Handle a block being disconnected from the chain tip. | xref:wallet/CWallet/chain.adoc[`chain`] | Interface for accessing chain state. | xref:wallet/CWallet/chainStateFlushed.adoc[`chainStateFlushed`] [.small]#[virtual]# | | xref:wallet/CWallet/postInitProcess.adoc[`postInitProcess`] | Wallet post‐init setup Gives the wallet a chance to register repetitive tasks and complete post‐init tasks | xref:wallet/CWallet/transactionAddedToMempool.adoc[`transactionAddedToMempool`] [.small]#[virtual]# | Handle a transaction being added to the node's mempool. | xref:wallet/CWallet/transactionRemovedFromMempool.adoc[`transactionRemovedFromMempool`] [.small]#[virtual]# | Handle a transaction being removed from the node's mempool. | xref:wallet/CWallet/updatedBlockTip.adoc[`updatedBlockTip`] [.small]#[virtual]# | Handle the chain tip being updated. |=== == Static Member Functions [cols="1,4"] |=== | Name| Description | xref:wallet/CWallet/CreateNew.adoc[`CreateNew`] | Initializes, creates and returns a new CWallet; returns a null pointer in case of an error | xref:wallet/CWallet/LoadExisting.adoc[`LoadExisting`] | Initializes, loads, and returns a CWallet from an existing wallet; returns a null pointer in case of an error | xref:wallet/CWallet/LoadWalletArgs.adoc[`LoadWalletArgs`] | Apply command‐line and configuration arguments to a wallet. |=== == Data Members [cols="1,4"] |=== | Name| Description | xref:wallet/CWallet/NotifyAddressBookChanged.adoc[`NotifyAddressBookChanged`] | Address book entry changed. | xref:wallet/CWallet/NotifyCanGetAddressesChanged.adoc[`NotifyCanGetAddressesChanged`] | Keypool has new keys | xref:wallet/CWallet/NotifyStatusChanged.adoc[`NotifyStatusChanged`] | Wallet status (encrypted, locked) changed. Note: Called without locks held. | xref:wallet/CWallet/NotifyTransactionChanged.adoc[`NotifyTransactionChanged`] | Wallet transaction added, removed or updated. | xref:wallet/CWallet/NotifyUnload.adoc[`NotifyUnload`] | Wallet is about to be unloaded | xref:wallet/CWallet/ShowProgress.adoc[`ShowProgress`] | Show progress e.g. for rescan | xref:wallet/CWallet/cs_wallet.adoc[`cs_wallet`] | Main wallet lock. This lock protects all the fields added by CWallet. | xref:wallet/CWallet/m_address_book.adoc[`m_address_book`] | Address book entries indexed by destination. | xref:wallet/CWallet/m_allow_fallback_fee.adoc[`m_allow_fallback_fee`] | will be false if ‐fallbackfee=0 | xref:wallet/CWallet/m_chain_notifications_handler.adoc[`m_chain_notifications_handler`] | Registered interfaces::Chain::Notifications handler. | xref:wallet/CWallet/m_confirm_target.adoc[`m_confirm_target`] | Default confirmation target (in blocks) for fee estimation. | xref:wallet/CWallet/m_consolidate_feerate.adoc[`m_consolidate_feerate`] | When the actual feerate is less than the consolidate feerate, we will tend to make transactions which consolidate inputs. When the actual feerate is greater than the consolidate feerate, we will tend to make transactions which have the lowest fees. | xref:wallet/CWallet/m_default_address_type.adoc[`m_default_address_type`] | Default output type for newly generated receiving addresses. | xref:wallet/CWallet/m_default_change_type.adoc[`m_default_change_type`] | Default output type for change outputs. When unset, automatically choose type based on address type setting and the types other of non‐change outputs (see ‐changetype option documentation and implementation in CWallet::TransactionChangeType for details). | xref:wallet/CWallet/m_default_max_tx_fee.adoc[`m_default_max_tx_fee`] | Absolute maximum transaction fee (in satoshis) used by default for the wallet | xref:wallet/CWallet/m_discard_rate.adoc[`m_discard_rate`] | If the cost to spend a change output at this feerate is greater than the value of the output itself, just drop it to fees. | xref:wallet/CWallet/m_fallback_fee.adoc[`m_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 | xref:wallet/CWallet/m_keypool_size.adoc[`m_keypool_size`] | Number of pre‐generated keys/scripts by each spkm (part of the look‐ahead process, used to detect payments) | xref:wallet/CWallet/m_locked_coins.adoc[`m_locked_coins`] | Set of Coins owned by this wallet that we won't try to spend from. A Coin may be locked if it has already been used to fund a transaction that hasn't confirmed yet. We wouldn't consider the Coin spent already, but also shouldn't try to use it again. bool to track whether this locked coin is persisted to disk. | xref:wallet/CWallet/m_max_aps_fee.adoc[`m_max_aps_fee`] | note: this is absolute fee, not fee rate | xref:wallet/CWallet/m_min_fee.adoc[`m_min_fee`] | Minimum fee rate to use when creating transactions. | xref:wallet/CWallet/m_notify_tx_changed_script.adoc[`m_notify_tx_changed_script`] | Notify external script when a wallet transaction comes in or is updated (handled by ‐walletnotify) | xref:wallet/CWallet/m_relock_mutex.adoc[`m_relock_mutex`] | Used to prevent deleting the passphrase from memory when it is still in use. | xref:wallet/CWallet/m_signal_rbf.adoc[`m_signal_rbf`] | Whether new transactions signal opt‐in Replace‐By‐Fee. | xref:wallet/CWallet/m_spend_zero_conf_change.adoc[`m_spend_zero_conf_change`] | Allow Coin Selection to pick unconfirmed UTXOs that were sent from our own wallet if it cannot fund the transaction otherwise. | xref:wallet/CWallet/m_unlock_mutex.adoc[`m_unlock_mutex`] | Used to prevent concurrent calls to walletpassphrase RPC. | xref:wallet/CWallet/mapMasterKeys.adoc[`mapMasterKeys`] | Encrypted master keys held by this wallet, indexed by id. | xref:wallet/CWallet/mapWallet.adoc[`mapWallet`] | Map from txid to CWalletTx for all transactions this wallet is interested in, including received and sent transactions. | xref:wallet/CWallet/nMasterKeyMaxID.adoc[`nMasterKeyMaxID`] | Highest master key id assigned so far. | xref:wallet/CWallet/nOrderPosNext.adoc[`nOrderPosNext`] | Order position to assign to the next transaction added to the wallet. | xref:wallet/CWallet/nRelockTime.adoc[`nRelockTime`] | Holds a timestamp at which point the wallet is scheduled (externally) to be relocked. Caller must arrange for actual relocking to occur via Lock(). | xref:wallet/CWallet/wtxOrdered.adoc[`wtxOrdered`] | Wallet transactions ordered by their insertion order position. |=== == Friends [cols="1,4"] |=== | Name| Description | `xref:wallet/WalletRescanReserver.adoc[wallet::WalletRescanReserver]` | RAII object to check and reserve a wallet rescan |=== == Non-Member Functions [cols="1,4"] |=== | Name| Description | xref:wallet/AllInputsMine.adoc[`AllInputsMine`] | Returns whether all of the inputs belong to the wallet | xref:wallet/AutomaticCoinSelection.adoc[`AutomaticCoinSelection`] | Select a set of coins such that nTargetValue is met; never select unconfirmed coins if they are not ours | xref:wallet/AvailableCoins.adoc[`AvailableCoins`] | Populate the CoinsResult struct with vectors of available COutputs, organized by OutputType. | xref:wallet/CachedTxGetAmounts.adoc[`CachedTxGetAmounts`] | Splits a wallet transaction into received and sent entries plus its fee. | xref:wallet/CachedTxGetChange.adoc[`CachedTxGetChange`] | Returns the cached change amount of a wallet transaction. | xref:wallet/CachedTxGetCredit.adoc[`CachedTxGetCredit`] | Returns the cached total credit of a wallet transaction. | xref:wallet/CachedTxGetDebit.adoc[`CachedTxGetDebit`] | Returns the cached total debit of a wallet transaction. | xref:wallet/CachedTxIsFromMe.adoc[`CachedTxIsFromMe`] | Returns whether a wallet transaction debits from the wallet. | xref:wallet/CachedTxIsTrusted-0c.adoc[`CachedTxIsTrusted`] | Returns whether a wallet transaction is trusted. | xref:wallet/CachedTxIsTrusted-0e.adoc[`CachedTxIsTrusted`] | Returns whether a wallet transaction is trusted, tracking visited parents. | xref:wallet/CreateTransaction.adoc[`CreateTransaction`] | Create a new transaction paying the recipients with a set of coins selected by SelectCoins(); Also create the change output, when needed | xref:wallet/CreateWallet.adoc[`CreateWallet`] | Create a new wallet and load it into the context. | xref:wallet/EnsureWalletIsUnlocked.adoc[`EnsureWalletIsUnlocked`] | Throws an RPC error if the wallet is locked. | xref:wallet/ExportDescriptors.adoc[`ExportDescriptors`] | Export the descriptors from a wallet so that they can be imported elsewhere | xref:wallet/ExportWatchOnlyWallet.adoc[`ExportWatchOnlyWallet`] | Make a new watchonly wallet file containing the public descriptors from this wallet The exported watchonly wallet file will be named and placed at the path specified in 'destination' | xref:wallet/FetchSelectedInputs.adoc[`FetchSelectedInputs`] | Fetch and validate coin control selected inputs. Coins could be internal (from the wallet) or external. | xref:wallet/FindNonChangeParentOutput.adoc[`FindNonChangeParentOutput`] | Find non‐change parent output. | xref:wallet/FundTransaction.adoc[`FundTransaction`] | Insert additional inputs into the transaction by calling CreateTransaction(); | xref:wallet/GetAddressBalances.adoc[`GetAddressBalances`] | Returns the confirmed balance held at each of the wallet's addresses. | xref:wallet/GetAddressGroupings.adoc[`GetAddressGroupings`] | Groups addresses that are believed to share a common owner. | xref:wallet/GetAvoidReuseFlag.adoc[`GetAvoidReuseFlag`] | Resolves the effective avoid‐reuse flag from a request parameter. | xref:wallet/GetBalance.adoc[`GetBalance`] | Computes the wallet's balance broken down by category. | xref:wallet/GetDefaultWallet.adoc[`GetDefaultWallet`] | Return the default wallet and report how many wallets are loaded. | xref:wallet/GetDiscardRate.adoc[`GetDiscardRate`] | Return the maximum feerate for discarding change. | xref:wallet/GetMinimumFeeRate.adoc[`GetMinimumFeeRate`] | Estimate the minimum fee rate considering user set parameters and the required fee | xref:wallet/GetRequiredFee.adoc[`GetRequiredFee`] | Return the minimum required absolute fee for this size based on the required fee rate | xref:wallet/GetRequiredFeeRate.adoc[`GetRequiredFeeRate`] | Return the minimum required feerate taking into account the minimum relay feerate and user set minimum transaction feerate | xref:wallet/GetWallet.adoc[`GetWallet`] | Look up a loaded wallet by name. | xref:wallet/GetWalletForJSONRPCRequest.adoc[`GetWalletForJSONRPCRequest`] | Figures out what wallet, if any, to use for a JSONRPCRequest. | xref:wallet/GroupOutputs.adoc[`GroupOutputs`] | Group coins by the provided filters. | xref:wallet/HasLegacyRecords-08.adoc[`HasLegacyRecords`] | Returns true if there are any DBKeys::LEGACY_TYPES record in the wallet db. | xref:wallet/HasLegacyRecords-0f.adoc[`HasLegacyRecords`] | Returns true if there are any DBKeys::LEGACY_TYPES record in the wallet db | xref:wallet/InputIsMine.adoc[`InputIsMine`] | Returns whether the output spent by an input belongs to the wallet. | xref:wallet/ListCoins.adoc[`ListCoins`] | Return list of available coins and locked coins grouped by non‐change output address. | xref:wallet/LoadCryptedKey.adoc[`LoadCryptedKey`] | Loads an encrypted key from a database record into the wallet. | xref:wallet/LoadEncryptionKey.adoc[`LoadEncryptionKey`] | Loads a master encryption key from a database record into the wallet. | xref:wallet/LoadHDChain.adoc[`LoadHDChain`] | Loads HD chain data from a database record into the wallet. | xref:wallet/LoadKey.adoc[`LoadKey`] | Loads an unencrypted key from a database record into the wallet. | xref:wallet/LoadWallet.adoc[`LoadWallet`] | Load an existing wallet from disk into the context. | xref:wallet/OutputGetChange.adoc[`OutputGetChange`] | Returns the change amount an output contributes. | xref:wallet/OutputGetCredit.adoc[`OutputGetCredit`] | Returns the credit an output contributes if it belongs to the wallet. | xref:wallet/OutputIsChange.adoc[`OutputIsChange`] | Returns whether an output is a change output of the wallet. | xref:wallet/PushParentDescriptors.adoc[`PushParentDescriptors`] | Fetch parent descriptors of this scriptPubKey. | xref:wallet/RestoreWallet.adoc[`RestoreWallet`] | Restore a wallet from a backup file. | xref:wallet/ScriptIsChange.adoc[`ScriptIsChange`] | Returns whether a script is a change output of the wallet. | xref:wallet/SelectCoins.adoc[`SelectCoins`] | Select all coins from coin_control, and if coin_control 'm_allow_other_inputs=true', call 'AutomaticCoinSelection' to select a set of coins such that nTargetValue ‐ pre_set_inputs.total_amount is met. | xref:wallet/TxGetChange.adoc[`TxGetChange`] | Returns the total change amount of a transaction. | xref:wallet/TxGetCredit.adoc[`TxGetCredit`] | Returns the total credit of a transaction's outputs owned by the wallet. | xref:wallet/feebumper/CommitTransaction.adoc[`feebumper::CommitTransaction`] | Commit the bumpfee transaction. | xref:wallet/feebumper/CreateRateBumpTransaction.adoc[`feebumper::CreateRateBumpTransaction`] | Create bumpfee transaction based on feerate estimates. | xref:wallet/feebumper/SignTransaction.adoc[`feebumper::SignTransaction`] | Sign the new transaction, | xref:wallet/feebumper/TransactionCanBeBumped.adoc[`feebumper::TransactionCanBeBumped`] | Return whether transaction can be bumped. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#