Bitcoin Core  0.15.99
P2P Digital Currency
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 ()
 
 CWalletTx (const CWallet *pwalletIn, CTransactionRef arg)
 
void Init (const CWallet *pwalletIn)
 
template<typename Stream , typename Operation >
void SerializationOp (Stream &s, Operation ser_action)
 
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
 
CAmount GetImmatureCredit (bool fUseCache=true) const
 
CAmount GetAvailableCredit (bool fUseCache=true) const
 
CAmount GetImmatureWatchOnlyCredit (const bool &fUseCache=true) const
 
CAmount GetAvailableWatchOnlyCredit (const bool &fUseCache=true) const
 
CAmount GetChange () const
 
void GetAmounts (std::list< COutputEntry > &listReceived, std::list< COutputEntry > &listSent, CAmount &nFee, std::string &strSentAccount, const isminefilter &filter) const
 
bool IsFromMe (const isminefilter &filter) const
 
bool IsEquivalentTo (const CWalletTx &tx) const
 
bool InMempool () const
 
bool IsTrusted () const
 
int64_t GetTxTime () const
 
int GetRequestCount () const
 
bool RelayWalletTransaction (CConnman *connman)
 
std::set< uint256GetConflicts () const
 
- Public Member Functions inherited from CMerkleTx
 CMerkleTx ()
 
 CMerkleTx (CTransactionRef arg)
 
 operator const CTransaction & () const
 Helper conversion operator to allow passing CMerkleTx where CTransaction is expected. More...
 
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 CBlockIndex *&pindexRet) const
 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...
 
int GetDepthInMainChain () const
 
bool IsInMainChain () const
 
int GetBlocksToMaturity () const
 
bool AcceptToMemoryPool (const CAmount &nAbsurdFee, CValidationState &state)
 Pass this transaction to the mempool. More...
 
bool hashUnset () const
 
bool isAbandoned () const
 
void setAbandoned ()
 
const uint256GetHash () const
 
bool IsCoinBase () const
 

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...
 
std::string strFromAccount
 
int64_t nOrderPos
 position in ordered transaction list More...
 
bool fDebitCached
 
bool fCreditCached
 
bool fImmatureCreditCached
 
bool fAvailableCreditCached
 
bool fWatchDebitCached
 
bool fWatchCreditCached
 
bool fImmatureWatchCreditCached
 
bool fAvailableWatchCreditCached
 
bool fChangeCached
 
CAmount nDebitCached
 
CAmount nCreditCached
 
CAmount nImmatureCreditCached
 
CAmount nAvailableCreditCached
 
CAmount nWatchDebitCached
 
CAmount nWatchCreditCached
 
CAmount nImmatureWatchCreditCached
 
CAmount nAvailableWatchCreditCached
 
CAmount nChangeCached
 
 ADD_SERIALIZE_METHODS
 
- 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 269 of file wallet.h.

Constructor & Destructor Documentation

CWalletTx::CWalletTx ( )
inline

Definition at line 343 of file wallet.h.

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

Definition at line 348 of file wallet.h.

Member Function Documentation

void CWalletTx::BindWallet ( CWallet pwalletIn)
inline

Definition at line 441 of file wallet.h.

Here is the caller graph for this function:

void CWalletTx::Init ( const CWallet pwalletIn)
inline

Definition at line 353 of file wallet.h.

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

Definition at line 459 of file wallet.h.

Here is the caller graph for this function:

void CWalletTx::MarkDirty ( )
inline

make sure balances are recalculated

Definition at line 428 of file wallet.h.

Here is the caller graph for this function:

template<typename Stream , typename Operation >
void CWalletTx::SerializationOp ( Stream &  s,
Operation  ser_action 
)
inline

< Used to be vtxPrev

Definition at line 387 of file wallet.h.

Here is the call graph for this function:

Member Data Documentation

CWalletTx::ADD_SERIALIZE_METHODS

Definition at line 384 of file wallet.h.

bool CWalletTx::fAvailableCreditCached
mutable

Definition at line 327 of file wallet.h.

bool CWalletTx::fAvailableWatchCreditCached
mutable

Definition at line 331 of file wallet.h.

bool CWalletTx::fChangeCached
mutable

Definition at line 332 of file wallet.h.

bool CWalletTx::fCreditCached
mutable

Definition at line 325 of file wallet.h.

bool CWalletTx::fDebitCached
mutable

Definition at line 324 of file wallet.h.

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 319 of file wallet.h.

bool CWalletTx::fImmatureCreditCached
mutable

Definition at line 326 of file wallet.h.

bool CWalletTx::fImmatureWatchCreditCached
mutable

Definition at line 330 of file wallet.h.

unsigned int CWalletTx::fTimeReceivedIsTxTime

Definition at line 302 of file wallet.h.

bool CWalletTx::fWatchCreditCached
mutable

Definition at line 329 of file wallet.h.

bool CWalletTx::fWatchDebitCached
mutable

Definition at line 328 of file wallet.h.

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,
                    sendfrom, 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 300 of file wallet.h.

CAmount CWalletTx::nAvailableCreditCached
mutable

Definition at line 336 of file wallet.h.

CAmount CWalletTx::nAvailableWatchCreditCached
mutable

Definition at line 340 of file wallet.h.

CAmount CWalletTx::nChangeCached
mutable

Definition at line 341 of file wallet.h.

CAmount CWalletTx::nCreditCached
mutable

Definition at line 334 of file wallet.h.

CAmount CWalletTx::nDebitCached
mutable

Definition at line 333 of file wallet.h.

CAmount CWalletTx::nImmatureCreditCached
mutable

Definition at line 335 of file wallet.h.

CAmount CWalletTx::nImmatureWatchCreditCached
mutable

Definition at line 339 of file wallet.h.

int64_t CWalletTx::nOrderPos

position in ordered transaction list

Definition at line 321 of file wallet.h.

unsigned int CWalletTx::nTimeReceived

time received by this node

Definition at line 303 of file wallet.h.

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 313 of file wallet.h.

CAmount CWalletTx::nWatchCreditCached
mutable

Definition at line 338 of file wallet.h.

CAmount CWalletTx::nWatchDebitCached
mutable

Definition at line 337 of file wallet.h.

const CWallet* CWalletTx::pwallet
private

Definition at line 272 of file wallet.h.

std::string CWalletTx::strFromAccount

Definition at line 320 of file wallet.h.

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

Definition at line 301 of file wallet.h.


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