[#wallet-CWalletTx]
= xref:wallet.adoc[wallet]::CWalletTx
:relfileprefix: ../
:mrdocs:

A transaction with a bunch of additional info that only the owner cares about&period; It includes any unrecorded transactions needed to link it back to the block chain&period;

== Synopsis

Declared in `&lt;wallet&sol;transaction&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class CWalletTx;
----

== Enums

[cols="1,4"]
|===
| Name| Description
| xref:wallet/CWalletTx/AmountType.adoc[`AmountType`] 
| Which balance an entry of m&lowbar;amounts holds&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:wallet/CWalletTx/2constructor-09.adoc[`CWalletTx`]         [.small]#[constructor]#
| Constructors
| xref:wallet/CWalletTx/operator_assign.adoc[`operator&equals;`]  [.small]#[deleted]#
| Deleted copy assignment&semi; CWalletTx objects must not be copied&period;
| xref:wallet/CWalletTx/GetHash.adoc[`GetHash`] 
| Return the txid of the canonical transaction&period;
| xref:wallet/CWalletTx/GetTx.adoc[`GetTx`] 
| Return the canonical transaction backing this wallet transaction&period;
| xref:wallet/CWalletTx/GetTxTime.adoc[`GetTxTime`] 
| Return the smart timestamp associated with the transaction&period;
| xref:wallet/CWalletTx/GetTxs.adoc[`GetTxs`] 
| Return the map of stored transaction variants keyed by witness txid&period;
| xref:wallet/CWalletTx/GetWitnessHash.adoc[`GetWitnessHash`] 
| Return the witness txid of the canonical transaction&period;
| xref:wallet/CWalletTx/InMempool.adoc[`InMempool`] 
| Return whether the transaction is currently in the mempool&period;
| xref:wallet/CWalletTx/IsCoinBase.adoc[`IsCoinBase`] 
| Return whether the transaction is a coinbase transaction&period;
| xref:wallet/CWalletTx/IsEquivalentTo.adoc[`IsEquivalentTo`] 
| True if only scriptSigs are different
| xref:wallet/CWalletTx/MarkDirty.adoc[`MarkDirty`] 
| make sure balances are recalculated
| xref:wallet/CWalletTx/Serialize.adoc[`Serialize`] 
| Serialize the wallet transaction to the given stream&period;
| xref:wallet/CWalletTx/Unserialize.adoc[`Unserialize`] 
| Deserialize the wallet transaction from the given stream&period;
| xref:wallet/CWalletTx/Update.adoc[`Update`] 
| Update the state of this wallet transaction along with a transaction that may have a different wtxid&period; If the given transaction has a different wtxid, the transaction is stored if it has not been seen before&period; The canonical wtxid is also updated&period; The tx that is confirmed becomes canonical&period; For unconfirmed txs, those with witnesses are preferred, followed by least weight&period;
| xref:wallet/CWalletTx/isAbandoned.adoc[`isAbandoned`] 
| Return whether the transaction has been abandoned&period;
| xref:wallet/CWalletTx/isBlockConflicted.adoc[`isBlockConflicted`] 
| Return whether the transaction conflicts with a confirmed block&period;
| xref:wallet/CWalletTx/isConfirmed.adoc[`isConfirmed`] 
| Return whether the transaction is confirmed in a block&period;
| xref:wallet/CWalletTx/isInactive.adoc[`isInactive`] 
| Return whether the transaction is in an inactive state&period;
| xref:wallet/CWalletTx/isMempoolConflicted.adoc[`isMempoolConflicted`] 
| Return whether the transaction conflicts with a mempool transaction&period;
| xref:wallet/CWalletTx/isUnconfirmed.adoc[`isUnconfirmed`] 
| Return whether the transaction is unconfirmed and not otherwise flagged&period;
| xref:wallet/CWalletTx/state-02.adoc[`state`] 
| Return a pointer to the current state if it is of type T, otherwise nullptr&period;
| xref:wallet/CWalletTx/updateState.adoc[`updateState`] 
| Update transaction state when attaching to a chain, filling in heights of conflicted and confirmed blocks
|===


== Data Members

[cols="1,4"]
|===
| Name| Description
| xref:wallet/CWalletTx/fChangeCached.adoc[`fChangeCached`] 
| Whether nChangeCached currently holds a valid value&period;
| xref:wallet/CWalletTx/m_amounts.adoc[`m&lowbar;amounts`] 
| Cached debit and credit balances&period;
| xref:wallet/CWalletTx/m_cached_from_me.adoc[`m&lowbar;cached&lowbar;from&lowbar;me`] 
| Cached value for whether the transaction spends any inputs known to the wallet&period;
| xref:wallet/CWalletTx/m_comment.adoc[`m&lowbar;comment`] 
| User&hyphen;provided comment string&period;
| xref:wallet/CWalletTx/m_comment_to.adoc[`m&lowbar;comment&lowbar;to`] 
| User&hyphen;provided comment describing the recipient&period;
| xref:wallet/CWalletTx/m_from.adoc[`m&lowbar;from`] 
| Obsolete &quot;from&quot; metadata retained from old wallets&period;
| xref:wallet/CWalletTx/m_is_cache_empty.adoc[`m&lowbar;is&lowbar;cache&lowbar;empty`] 
| This flag is true if all m&lowbar;amounts caches are empty&period; This is particularly useful in places where MarkDirty is conditionally called and the condition can be expensive and thus can be skipped if the flag is true&period; See MarkDestinationsDirty&period;
| xref:wallet/CWalletTx/m_it_wtxOrdered.adoc[`m&lowbar;it&lowbar;wtxOrdered`] 
| Iterator into the wallet&apos;s ordered transaction map&period;
| xref:wallet/CWalletTx/m_message.adoc[`m&lowbar;message`] 
| Obsolete &quot;message&quot; metadata retained from old wallets&period;
| xref:wallet/CWalletTx/m_messages.adoc[`m&lowbar;messages`] 
| BIP 21 URI messages associated with the transaction&period;
| xref:wallet/CWalletTx/m_payment_requests.adoc[`m&lowbar;payment&lowbar;requests`] 
| Deprecated BIP 70 payment requests retained from old wallets&period;
| xref:wallet/CWalletTx/m_replaced_by_txid.adoc[`m&lowbar;replaced&lowbar;by&lowbar;txid`] 
| Txid of the transaction that replaces this one, if any&period;
| xref:wallet/CWalletTx/m_replaces_txid.adoc[`m&lowbar;replaces&lowbar;txid`] 
| Txid of the transaction this one replaces, if any&period;
| xref:wallet/CWalletTx/m_state.adoc[`m&lowbar;state`] 
| Current confirmation state of the transaction&period;
| xref:wallet/CWalletTx/mempool_conflicts.adoc[`mempool&lowbar;conflicts`] 
| Mempool transactions that conflict directly or via an ancestor&period;
| xref:wallet/CWalletTx/nChangeCached.adoc[`nChangeCached`] 
| Cached change amount of the transaction&period;
| xref:wallet/CWalletTx/nOrderPos.adoc[`nOrderPos`] 
| position in ordered transaction list
| xref:wallet/CWalletTx/nTimeReceived.adoc[`nTimeReceived`] 
| time received by this node
| xref:wallet/CWalletTx/nTimeSmart.adoc[`nTimeSmart`] 
| Stable timestamp that never changes, and reflects the order a transaction was added to the wallet&period; Timestamp is based on the block time for a transaction added as part of a block, or else the time when the transaction was received if it wasn&apos;t part of a block, with the timestamp adjusted in both cases so timestamp order matches the order transactions were added to the wallet&period; More details can be found in CWallet&colon;&colon;ComputeTimeSmart()&period;
| xref:wallet/CWalletTx/truc_child_in_mempool.adoc[`truc&lowbar;child&lowbar;in&lowbar;mempool`] 
| TRUC (v3) mempool child spending from this transaction, if any&period;
|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
