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

Synopsis

Declared in <wallet/transaction.h>

class CWalletTx;

Enums

Name

Description

AmountType

Which balance an entry of m_amounts holds.

Member Functions

Name

Description

CWalletTx [constructor]

Constructors

operator= [deleted]

Deleted copy assignment; CWalletTx objects must not be copied.

GetHash

Return the txid of the canonical transaction.

GetTx

Return the canonical transaction backing this wallet transaction.

GetTxTime

Return the smart timestamp associated with the transaction.

GetTxs

Return the map of stored transaction variants keyed by witness txid.

GetWitnessHash

Return the witness txid of the canonical transaction.

InMempool

Return whether the transaction is currently in the mempool.

IsCoinBase

Return whether the transaction is a coinbase transaction.

IsEquivalentTo

True if only scriptSigs are different

MarkDirty

make sure balances are recalculated

Serialize

Serialize the wallet transaction to the given stream.

Unserialize

Deserialize the wallet transaction from the given stream.

Update

Update the state of this wallet transaction along with a transaction that may have a different wtxid. If the given transaction has a different wtxid, the transaction is stored if it has not been seen before. The canonical wtxid is also updated. The tx that is confirmed becomes canonical. For unconfirmed txs, those with witnesses are preferred, followed by least weight.

isAbandoned

Return whether the transaction has been abandoned.

isBlockConflicted

Return whether the transaction conflicts with a confirmed block.

isConfirmed

Return whether the transaction is confirmed in a block.

isInactive

Return whether the transaction is in an inactive state.

isMempoolConflicted

Return whether the transaction conflicts with a mempool transaction.

isUnconfirmed

Return whether the transaction is unconfirmed and not otherwise flagged.

state

Return a pointer to the current state if it is of type T, otherwise nullptr.

updateState

Update transaction state when attaching to a chain, filling in heights of conflicted and confirmed blocks

Data Members

Name

Description

fChangeCached

Whether nChangeCached currently holds a valid value.

m_amounts

Cached debit and credit balances.

m_cached_from_me

Cached value for whether the transaction spends any inputs known to the wallet.

m_comment

User‐provided comment string.

m_comment_to

User‐provided comment describing the recipient.

m_from

Obsolete "from" metadata retained from old wallets.

m_is_cache_empty

This flag is true if all m_amounts caches are empty. 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. See MarkDestinationsDirty.

m_it_wtxOrdered

Iterator into the wallet's ordered transaction map.

m_message

Obsolete "message" metadata retained from old wallets.

m_messages

BIP 21 URI messages associated with the transaction.

m_payment_requests

Deprecated BIP 70 payment requests retained from old wallets.

m_replaced_by_txid

Txid of the transaction that replaces this one, if any.

m_replaces_txid

Txid of the transaction this one replaces, if any.

m_state

Current confirmation state of the transaction.

mempool_conflicts

Mempool transactions that conflict directly or via an ancestor.

nChangeCached

Cached change amount of the transaction.

nOrderPos

position in ordered transaction list

nTimeReceived

time received by this node

nTimeSmart

Stable timestamp that never changes, and reflects the order a transaction was added to the wallet. 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't part of a block, with the timestamp adjusted in both cases so timestamp order matches the order transactions were added to the wallet. More details can be found in CWallet::ComputeTimeSmart().

truc_child_in_mempool

TRUC (v3) mempool child spending from this transaction, if any.

Created with MrDocs