BSHA3  0.17.99
P2P Blockchain, based on Bitcoin
Public Member Functions | Public Attributes | Private Attributes | List of all members
CWalletTx Class Reference

A transaction with a bunch of additional info that only the owner cares about. More...

#include <wallet.h>

Inheritance diagram for CWalletTx:
[legend]
Collaboration diagram for CWalletTx:
[legend]

Public Member Functions

 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 (const isminefilter &filter) const EXCLUSIVE_LOCKS_REQUIRED(cs_main)
 
CAmount GetImmatureCredit (bool fUseCache=true) const EXCLUSIVE_LOCKS_REQUIRED(cs_main)
 
CAmount GetAvailableCredit (bool fUseCache=true, const isminefilter &filter=ISMINE_SPENDABLE) const NO_THREAD_SAFETY_ANALYSIS
 
CAmount GetImmatureWatchOnlyCredit (const bool fUseCache=true) const EXCLUSIVE_LOCKS_REQUIRED(cs_main)
 
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 () const EXCLUSIVE_LOCKS_REQUIRED(cs_main)
 
int64_t GetTxTime () const
 
bool RelayWalletTransaction (CConnman *connman) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
 
bool AcceptToMemoryPool (const CAmount &nAbsurdFee, CValidationState &state) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
 Pass this transaction to the mempool. More...
 
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 CBlockIndex *pIndex, int posInBlock)
 
int GetDepthInMainChain () const EXCLUSIVE_LOCKS_REQUIRED(cs_main)
 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. More...
 
bool IsInMainChain () const EXCLUSIVE_LOCKS_REQUIRED(cs_main)
 
int GetBlocksToMaturity () const EXCLUSIVE_LOCKS_REQUIRED(cs_main)
 
bool hashUnset () const
 
bool isAbandoned () const
 
void setAbandoned ()
 
const uint256GetHash () const
 
bool IsCoinBase () const
 
bool IsImmatureCoinBase () const EXCLUSIVE_LOCKS_REQUIRED(cs_main)
 

Public Attributes

mapValue_t mapValue
 Key/value map with information about the transaction. More...
 
std::vector< std::pair< std::string, std::string > > vOrderForm
 
unsigned int fTimeReceivedIsTxTime
 
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...
 
char 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. More...
 
int64_t nOrderPos
 position in ordered transaction list More...
 
std::multimap< int64_t, CWalletTx * >::const_iterator m_it_wtxOrdered
 
bool fDebitCached
 
bool fCreditCached
 
bool fImmatureCreditCached
 
bool fAvailableCreditCached
 
bool fWatchDebitCached
 
bool fWatchCreditCached
 
bool fImmatureWatchCreditCached
 
bool fAvailableWatchCreditCached
 
bool fChangeCached
 
bool fInMempool
 
CAmount nDebitCached
 
CAmount nCreditCached
 
CAmount nImmatureCreditCached
 
CAmount nAvailableCreditCached
 
CAmount nWatchDebitCached
 
CAmount nWatchCreditCached
 
CAmount nImmatureWatchCreditCached
 
CAmount nAvailableWatchCreditCached
 
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.

Definition at line 295 of file wallet.h.

Constructor & Destructor Documentation

◆ CWalletTx()

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

Definition at line 370 of file wallet.h.

Here is the call graph for this function:

Member Function Documentation

◆ AcceptToMemoryPool()

bool CWalletTx::AcceptToMemoryPool ( const CAmount nAbsurdFee,
CValidationState state 
)

Pass this transaction to the mempool.

Fails if absolute fee exceeds absurd fee.

Definition at line 4261 of file wallet.cpp.

Here is the caller graph for this function:

◆ BindWallet()

void CWalletTx::BindWallet ( CWallet pwalletIn)
inline

Definition at line 456 of file wallet.h.

Here is the caller graph for this function:

◆ GetSpendSize()

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

Definition at line 475 of file wallet.h.

Here is the call graph for this function:

◆ Init()

void CWalletTx::Init ( const CWallet pwalletIn)
inline

Definition at line 375 of file wallet.h.

◆ IsFromMe()

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

Definition at line 483 of file wallet.h.

Here is the caller graph for this function:

◆ MarkDirty()

void CWalletTx::MarkDirty ( )
inline

make sure balances are recalculated

Definition at line 443 of file wallet.h.

Here is the caller graph for this function:

◆ Serialize()

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

< Used to be vtxPrev

Definition at line 407 of file wallet.h.

◆ Unserialize()

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

< Used to be vtxPrev

Definition at line 424 of file wallet.h.

Here is the call graph for this function:

Member Data Documentation

◆ fAvailableCreditCached

bool CWalletTx::fAvailableCreditCached
mutable

Definition at line 353 of file wallet.h.

◆ fAvailableWatchCreditCached

bool CWalletTx::fAvailableWatchCreditCached
mutable

Definition at line 357 of file wallet.h.

◆ fChangeCached

bool CWalletTx::fChangeCached
mutable

Definition at line 358 of file wallet.h.

◆ fCreditCached

bool CWalletTx::fCreditCached
mutable

Definition at line 351 of file wallet.h.

◆ fDebitCached

bool CWalletTx::fDebitCached
mutable

Definition at line 350 of file wallet.h.

◆ 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.

Definition at line 345 of file wallet.h.

◆ fImmatureCreditCached

bool CWalletTx::fImmatureCreditCached
mutable

Definition at line 352 of file wallet.h.

◆ fImmatureWatchCreditCached

bool CWalletTx::fImmatureWatchCreditCached
mutable

Definition at line 356 of file wallet.h.

◆ fInMempool

bool CWalletTx::fInMempool
mutable

Definition at line 359 of file wallet.h.

◆ fTimeReceivedIsTxTime

unsigned int CWalletTx::fTimeReceivedIsTxTime

Definition at line 328 of file wallet.h.

◆ fWatchCreditCached

bool CWalletTx::fWatchCreditCached
mutable

Definition at line 355 of file wallet.h.

◆ fWatchDebitCached

bool CWalletTx::fWatchDebitCached
mutable

Definition at line 354 of file wallet.h.

◆ m_it_wtxOrdered

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

Definition at line 347 of file wallet.h.

◆ 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)

Definition at line 326 of file wallet.h.

◆ nAvailableCreditCached

CAmount CWalletTx::nAvailableCreditCached
mutable

Definition at line 363 of file wallet.h.

◆ nAvailableWatchCreditCached

CAmount CWalletTx::nAvailableWatchCreditCached
mutable

Definition at line 367 of file wallet.h.

◆ nChangeCached

CAmount CWalletTx::nChangeCached
mutable

Definition at line 368 of file wallet.h.

◆ nCreditCached

CAmount CWalletTx::nCreditCached
mutable

Definition at line 361 of file wallet.h.

◆ nDebitCached

CAmount CWalletTx::nDebitCached
mutable

Definition at line 360 of file wallet.h.

◆ nImmatureCreditCached

CAmount CWalletTx::nImmatureCreditCached
mutable

Definition at line 362 of file wallet.h.

◆ nImmatureWatchCreditCached

CAmount CWalletTx::nImmatureWatchCreditCached
mutable

Definition at line 366 of file wallet.h.

◆ nOrderPos

int64_t CWalletTx::nOrderPos

position in ordered transaction list

Definition at line 346 of file wallet.h.

◆ nTimeReceived

unsigned int CWalletTx::nTimeReceived

time received by this node

Definition at line 329 of file wallet.h.

◆ 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().

Definition at line 339 of file wallet.h.

◆ nWatchCreditCached

CAmount CWalletTx::nWatchCreditCached
mutable

Definition at line 365 of file wallet.h.

◆ nWatchDebitCached

CAmount CWalletTx::nWatchDebitCached
mutable

Definition at line 364 of file wallet.h.

◆ pwallet

const CWallet* CWalletTx::pwallet
private

Definition at line 298 of file wallet.h.

◆ vOrderForm

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

Definition at line 327 of file wallet.h.


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