Bitcoin
Public Types | Public Member Functions | Public Attributes | Private Attributes | List of all members
CWalletTx Class Reference

#include <wallet.h>

Inheritance diagram for CWalletTx:
CMerkleTx

Public Types

enum  AmountType {
  DEBIT, CREDIT, IMMATURE_CREDIT, AVAILABLE_CREDIT,
  AMOUNTTYPE_ENUM_ELEMENTS
}
 

Public Member Functions

CAmount GetCachableAmount (AmountType type, const isminefilter &filter, bool recalculate=false) const
 
 CWalletTx (const CWallet *pwalletIn, CTransactionRef arg)
 
void Init (const CWallet *pwalletIn)
 
template<typename Stream >
void Serialize (Stream &s) const
 
template<typename Stream >
void Unserialize (Stream &s)
 
void MarkDirty ()
 make sure balances are recalculated More...
 
void BindWallet (CWallet *pwalletIn)
 
CAmount GetDebit (const isminefilter &filter) const
 filter decides which addresses will count towards the debit More...
 
CAmount GetCredit (interfaces::Chain::Lock &locked_chain, const isminefilter &filter) const
 
CAmount GetImmatureCredit (interfaces::Chain::Lock &locked_chain, bool fUseCache=true) const
 
CAmount GetAvailableCredit (interfaces::Chain::Lock &locked_chain, bool fUseCache=true, const isminefilter &filter=ISMINE_SPENDABLE) const NO_THREAD_SAFETY_ANALYSIS
 
CAmount GetImmatureWatchOnlyCredit (interfaces::Chain::Lock &locked_chain, const bool fUseCache=true) const
 
CAmount GetChange () const
 
int GetSpendSize (unsigned int out, bool use_max_sig=false) const
 
void GetAmounts (std::list< COutputEntry > &listReceived, std::list< COutputEntry > &listSent, CAmount &nFee, const isminefilter &filter) const
 
bool IsFromMe (const isminefilter &filter) const
 
bool IsEquivalentTo (const CWalletTx &tx) const
 
bool InMempool () const
 
bool IsTrusted (interfaces::Chain::Lock &locked_chain) const
 
int64_t GetTxTime () const
 
bool RelayWalletTransaction (interfaces::Chain::Lock &locked_chain)
 
bool AcceptToMemoryPool (interfaces::Chain::Lock &locked_chain, CValidationState &state)
 
std::set< uint256GetConflicts () const NO_THREAD_SAFETY_ANALYSIS
 
- Public Member Functions inherited from CMerkleTx
 CMerkleTx ()
 
 CMerkleTx (CTransactionRef arg)
 
void Init ()
 
void SetTx (CTransactionRef arg)
 
template<typename Stream , typename Operation >
void SerializationOp (Stream &s, Operation ser_action)
 
void SetMerkleBranch (const uint256 &block_hash, int posInBlock)
 
int GetDepthInMainChain (interfaces::Chain::Lock &locked_chain) const
 
bool IsInMainChain (interfaces::Chain::Lock &locked_chain) const
 
int GetBlocksToMaturity (interfaces::Chain::Lock &locked_chain) const
 
bool hashUnset () const
 
bool isAbandoned () const
 
void setAbandoned ()
 
const uint256GetHash () const
 
bool IsCoinBase () const
 
bool IsImmatureCoinBase (interfaces::Chain::Lock &locked_chain) const
 

Public Attributes

mapValue_t mapValue
 
std::vector< std::pair< std::string, std::string > > vOrderForm
 
unsigned int fTimeReceivedIsTxTime
 
unsigned int nTimeReceived
 time received by this node More...
 
unsigned int nTimeSmart
 
char fFromMe
 
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 fChangeCached
 
bool fInMempool
 
CAmount nChangeCached
 
- Public Attributes inherited from CMerkleTx
CTransactionRef tx
 
uint256 hashBlock
 
int nIndex
 
 ADD_SERIALIZE_METHODS
 

Private Attributes

const CWalletpwallet
 

Detailed Description

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.

Member Enumeration Documentation

◆ AmountType

Enumerator
DEBIT 
CREDIT 
IMMATURE_CREDIT 
AVAILABLE_CREDIT 
AMOUNTTYPE_ENUM_ELEMENTS 

Constructor & Destructor Documentation

◆ CWalletTx()

CWalletTx::CWalletTx ( const CWallet pwalletIn,
CTransactionRef  arg 
)
inline

Member Function Documentation

◆ AcceptToMemoryPool()

bool CWalletTx::AcceptToMemoryPool ( interfaces::Chain::Lock locked_chain,
CValidationState state 
)

Pass this transaction to the mempool. Fails if absolute fee exceeds absurd fee.

◆ BindWallet()

void CWalletTx::BindWallet ( CWallet pwalletIn)
inline

◆ GetSpendSize()

int CWalletTx::GetSpendSize ( unsigned int  out,
bool  use_max_sig = false 
) const
inline

◆ Init()

void CWalletTx::Init ( const CWallet pwalletIn)
inline

◆ IsFromMe()

bool CWalletTx::IsFromMe ( const isminefilter filter) const
inline

◆ MarkDirty()

void CWalletTx::MarkDirty ( )
inline

make sure balances are recalculated

◆ Serialize()

template<typename Stream >
void CWalletTx::Serialize ( Stream &  s) const
inline

< Used to be vtxPrev

◆ Unserialize()

template<typename Stream >
void CWalletTx::Unserialize ( Stream &  s)
inline

< Used to be vtxPrev

Member Data Documentation

◆ fChangeCached

bool CWalletTx::fChangeCached
mutable

◆ fFromMe

char CWalletTx::fFromMe

From me flag is set to 1 for transactions that were created by the wallet on this bitcoin node, and set to 0 for transactions that were created externally and came in through the network or sendrawtransaction RPC.

◆ fInMempool

bool CWalletTx::fInMempool
mutable

◆ fTimeReceivedIsTxTime

unsigned int CWalletTx::fTimeReceivedIsTxTime

◆ m_amounts

CachableAmount CWalletTx::m_amounts[AMOUNTTYPE_ENUM_ELEMENTS]
mutable

◆ m_it_wtxOrdered

std::multimap<int64_t, CWalletTx*>::const_iterator CWalletTx::m_it_wtxOrdered

◆ mapValue

mapValue_t CWalletTx::mapValue

Key/value map with information about the transaction.

The following keys can be read and written through the map and are serialized in the wallet database:

"comment", "to"   - comment strings provided to sendtoaddress,
                    and sendmany wallet RPCs
"replaces_txid"   - txid (as HexStr) of transaction replaced by
                    bumpfee on transaction created by bumpfee
"replaced_by_txid" - txid (as HexStr) of transaction created by
                    bumpfee on transaction replaced by bumpfee
"from", "message" - obsolete fields that could be set in UI prior to
                    2011 (removed in commit 4d9b223)

The following keys are serialized in the wallet database, but shouldn't be read or written through the map (they will be temporarily added and removed from the map during serialization):

"fromaccount"     - serialized strFromAccount value
"n"               - serialized nOrderPos value
"timesmart"       - serialized nTimeSmart value
"spent"           - serialized vfSpent value that existed prior to
                    2014 (removed in commit 93a18a3)

◆ nChangeCached

CAmount CWalletTx::nChangeCached
mutable

◆ nOrderPos

int64_t CWalletTx::nOrderPos

position in ordered transaction list

◆ nTimeReceived

unsigned int CWalletTx::nTimeReceived

time received by this node

◆ nTimeSmart

unsigned int 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().

◆ pwallet

const CWallet* CWalletTx::pwallet
private

◆ vOrderForm

std::vector<std::pair<std::string, std::string> > CWalletTx::vOrderForm

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