![]() |
Bitcoin Core 31.99.0
P2P Digital Currency
|
A transaction with a bunch of additional info that only the owner cares about. More...
#include <transaction.h>
Public Types | |
| enum | AmountType { DEBIT , CREDIT , AMOUNTTYPE_ENUM_ELEMENTS } |
Public Member Functions | |
| CWalletTx (CTransactionRef tx, const TxState &state) | |
| template<typename Stream > | |
| CWalletTx (deserialize_type, Stream &s, const std::map< Wtxid, CTransactionRef > &variants) | |
| template<typename Stream > | |
| void | Serialize (Stream &s) const |
| template<typename Stream > | |
| void | Unserialize (Stream &s) |
| CTransactionRef | GetTx () const |
| bool | Update (CTransactionRef tx, const TxState &new_state) |
| void | MarkDirty () |
| make sure balances are recalculated More... | |
| bool | IsEquivalentTo (const CWalletTx &tx) const |
| True if only scriptSigs are different. More... | |
| bool | InMempool () const |
| int64_t | GetTxTime () const |
| template<typename T > | |
| const T * | state () const |
| template<typename T > | |
| T * | state () |
| void | updateState (interfaces::Chain &chain) |
| Update transaction state when attaching to a chain, filling in heights of conflicted and confirmed blocks. More... | |
| bool | isAbandoned () const |
| bool | isMempoolConflicted () const |
| bool | isBlockConflicted () const |
| bool | isInactive () const |
| bool | isUnconfirmed () const |
| bool | isConfirmed () const |
| const Txid & | GetHash () const LIFETIMEBOUND |
| const Wtxid & | GetWitnessHash () const LIFETIMEBOUND |
| bool | IsCoinBase () const |
| const std::map< Wtxid, CTransactionRef > & | GetTxs () const |
| CWalletTx (const CWalletTx &)=delete | |
| CWalletTx & | operator= (const CWalletTx &)=delete |
| CWalletTx (CWalletTx &&)=default | |
Public Attributes | |
| std::optional< std::string > | m_from |
| std::optional< std::string > | m_message |
| std::optional< std::string > | m_comment |
| std::optional< std::string > | m_comment_to |
| std::optional< Txid > | m_replaces_txid |
| std::optional< Txid > | m_replaced_by_txid |
| std::vector< std::string > | m_messages |
| std::vector< std::string > | m_payment_requests |
| unsigned int | nTimeReceived |
| time received by this node More... | |
| unsigned int | nTimeSmart |
| Stable timestamp that never changes, and reflects the order a transaction was added to the wallet. More... | |
| std::optional< bool > | m_cached_from_me {std::nullopt} |
| int64_t | nOrderPos |
| position in ordered transaction list More... | |
| std::multimap< int64_t, CWalletTx * >::const_iterator | m_it_wtxOrdered |
| CachableAmount | m_amounts [AMOUNTTYPE_ENUM_ELEMENTS] |
| bool | m_is_cache_empty {true} |
| This flag is true if all m_amounts caches are empty. More... | |
| bool | fChangeCached |
| CAmount | nChangeCached |
| TxState | m_state |
| std::set< Txid > | mempool_conflicts |
| std::optional< Txid > | truc_child_in_mempool |
Private Member Functions | |
| void | SetDefaults () |
| void | Init () |
| void | RecomputeCanonical () |
| Set m_canonical_wtxid to the best variant under the unconfirmed rule (witnessed preferred, then least weight). More... | |
Private Attributes | |
| Wtxid | m_canonical_wtxid |
| std::map< Wtxid, CTransactionRef > | m_txs |
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.
Definition at line 191 of file transaction.h.
| Enumerator | |
|---|---|
| DEBIT | |
| CREDIT | |
| AMOUNTTYPE_ENUM_ELEMENTS | |
Definition at line 225 of file transaction.h.
|
inline |
|
inline |
|
delete |
|
default |
|
inline |
Definition at line 387 of file transaction.h.
|
inline |
|
inline |
| int64_t wallet::CWalletTx::GetTxTime | ( | ) | const |
|
inline |
Definition at line 388 of file transaction.h.
|
inlineprivate |
Definition at line 412 of file transaction.h.
| bool wallet::CWalletTx::InMempool | ( | ) | const |
|
inline |
|
inline |
|
inline |
Definition at line 389 of file transaction.h.
|
inline |
| bool wallet::CWalletTx::IsEquivalentTo | ( | const CWalletTx & | tx | ) | const |
True if only scriptSigs are different.
Definition at line 13 of file transaction.cpp.
|
inline |
|
inline |
|
inline |
Definition at line 385 of file transaction.h.
|
inline |
make sure balances are recalculated
Definition at line 358 of file transaction.h.
|
private |
Set m_canonical_wtxid to the best variant under the unconfirmed rule (witnessed preferred, then least weight).
Ignores state.
Definition at line 100 of file transaction.cpp.
|
inline |
|
inlineprivate |
|
inline |
Definition at line 375 of file transaction.h.
|
inline |
|
inline |
Definition at line 305 of file transaction.h.
| bool wallet::CWalletTx::Update | ( | CTransactionRef | tx, |
| const TxState & | new_state | ||
| ) |
Definition at line 64 of file transaction.cpp.
| void wallet::CWalletTx::updateState | ( | interfaces::Chain & | chain | ) |
Update transaction state when attaching to a chain, filling in heights of conflicted and confirmed blocks.
Definition at line 39 of file transaction.cpp.
|
mutable |
Definition at line 234 of file transaction.h.
|
mutable |
Definition at line 226 of file transaction.h.
|
mutable |
Definition at line 220 of file transaction.h.
|
private |
Definition at line 419 of file transaction.h.
| std::optional<std::string> wallet::CWalletTx::m_comment |
Definition at line 200 of file transaction.h.
| std::optional<std::string> wallet::CWalletTx::m_comment_to |
Definition at line 201 of file transaction.h.
| std::optional<std::string> wallet::CWalletTx::m_from |
Definition at line 197 of file transaction.h.
|
mutable |
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.
Definition at line 233 of file transaction.h.
| std::multimap<int64_t,CWalletTx*>::const_iterator wallet::CWalletTx::m_it_wtxOrdered |
Definition at line 222 of file transaction.h.
| std::optional<std::string> wallet::CWalletTx::m_message |
Definition at line 198 of file transaction.h.
| std::vector<std::string> wallet::CWalletTx::m_messages |
Definition at line 205 of file transaction.h.
| std::vector<std::string> wallet::CWalletTx::m_payment_requests |
Definition at line 207 of file transaction.h.
| std::optional<Txid> wallet::CWalletTx::m_replaced_by_txid |
Definition at line 203 of file transaction.h.
| std::optional<Txid> wallet::CWalletTx::m_replaces_txid |
Definition at line 202 of file transaction.h.
| TxState wallet::CWalletTx::m_state |
Definition at line 258 of file transaction.h.
|
private |
Definition at line 420 of file transaction.h.
| std::set<Txid> wallet::CWalletTx::mempool_conflicts |
Definition at line 266 of file transaction.h.
|
mutable |
Definition at line 235 of file transaction.h.
| int64_t wallet::CWalletTx::nOrderPos |
position in ordered transaction list
Definition at line 221 of file transaction.h.
| unsigned int wallet::CWalletTx::nTimeReceived |
time received by this node
Definition at line 208 of file transaction.h.
| unsigned int wallet::CWalletTx::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().
Definition at line 218 of file transaction.h.
| std::optional<Txid> wallet::CWalletTx::truc_child_in_mempool |
Definition at line 270 of file transaction.h.