PIVX Core  5.6.99
P2P Digital Currency
Classes | Public Types | Public Member Functions | Public Attributes | Private Attributes | Static 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>

Collaboration diagram for CWalletTx:
[legend]

Classes

struct  Confirmation
 

Public Types

enum  AmountType {
  DEBIT , CREDIT , IMMATURE_CREDIT , AVAILABLE_CREDIT ,
  AMOUNTTYPE_ENUM_ELEMENTS
}
 position in ordered transaction list More...
 
enum  Status { UNCONFIRMED , CONFIRMED , CONFLICTED , ABANDONED }
 

Public Member Functions

CAmount GetCachableAmount (AmountType type, const isminefilter &filter, bool recalculate=false) const
 
bool IsAmountCached (AmountType type, const isminefilter &filter) 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 SetTx (CTransactionRef arg)
 
void MarkDirty ()
 make sure balances are recalculated More...
 
void BindWallet (CWallet *pwalletIn)
 
void SetSaplingNoteData (mapSaplingNoteData_t &noteData)
 
Optional< std::pair< libzcash::SaplingNotePlaintext, libzcash::SaplingPaymentAddress > > DecryptSaplingNote (const SaplingOutPoint &op) const
 
Optional< std::pair< libzcash::SaplingNotePlaintext, libzcash::SaplingPaymentAddress > > RecoverSaplingNote (const SaplingOutPoint &op, const std::set< uint256 > &ovks) const
 
bool HasP2CSInputs () const
 checks whether a tx has P2CS inputs or not More...
 
void SetComment (const std::string &comment)
 Store a comment. More...
 
std::string GetComment () const
 
int GetDepthAndMempool (bool &fConflicted) const
 
CAmount GetDebit (const isminefilter &filter) const
 filter decides which addresses will count towards the debit More...
 
CAmount GetCredit (const isminefilter &filter, bool recalculate=false) const
 
CAmount GetImmatureCredit (bool fUseCache=true, const isminefilter &filter=ISMINE_SPENDABLE_ALL) const
 
CAmount GetAvailableCredit (bool fUseCache=true, const isminefilter &filter=ISMINE_SPENDABLE) const
 
CAmount GetLockedCredit () const
 
CAmount GetImmatureWatchOnlyCredit (const bool fUseCache=true) const
 
CAmount GetAvailableWatchOnlyCredit (const bool fUseCache=true) const
 
CAmount GetChange () const
 
CAmount GetShieldedChange () const
 
CAmount GetShieldedAvailableCredit (bool fUseCache=true) const
 
CAmount GetColdStakingCredit (bool fUseCache=true) const
 
CAmount GetColdStakingDebit (bool fUseCache=true) const
 
CAmount GetStakeDelegationCredit (bool fUseCache=true) const
 
CAmount GetStakeDelegationDebit (bool fUseCache=true) const
 
void GetAmounts (std::list< COutputEntry > &listReceived, std::list< COutputEntry > &listSent, CAmount &nFee, const isminefilter &filter) const
 
bool IsFromMe (const isminefilter &filter) const
 
bool InMempool () const
 
bool IsEquivalentTo (const CWalletTx &tx) const
 
bool IsTrusted () const
 
bool IsTrusted (int &nDepth, bool &fConflicted) const
 
int64_t GetTxTime () const
 
void UpdateTimeSmart ()
 Update smart timestamp for a transaction being added to the wallet. More...
 
void RelayWalletTransaction (CConnman *connman)
 
std::set< uint256GetConflicts () const
 
int GetDepthInMainChain () const NO_THREAD_SAFETY_ANALYSIS
 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 IsInMainChainImmature () const
 
int GetBlocksToMaturity () const
 
bool isAbandoned () const
 
void setAbandoned ()
 
bool isConflicted () const
 
void setConflicted ()
 
bool isUnconfirmed () const
 
void setUnconfirmed ()
 
bool isConfirmed () const
 
void setConfirmed ()
 
const uint256GetHash () const
 
bool IsCoinBase () const
 
bool IsCoinStake () const
 
bool AcceptToMemoryPool (CValidationState &state) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
 Pass this transaction to the mempool. More...
 

Public Attributes

mapValue_t mapValue
 
mapSaplingNoteData_t mapSaplingNoteData
 
std::vector< std::pair< std::string, std::string > > vOrderForm
 
unsigned int fTimeReceivedIsTxTime
 
unsigned int nTimeReceived
 
unsigned int nTimeSmart
 time received by this node More...
 
char fFromMe
 
int64_t nOrderPos
 
CachableAmount m_amounts [AMOUNTTYPE_ENUM_ELEMENTS]
 
bool fStakeDelegationVoided
 
bool fChangeCached
 
bool fInMempool
 
CAmount nChangeCached
 
bool fShieldedChangeCached
 
CAmount nShieldedChangeCached
 
CTransactionRef tx
 
Confirmation m_confirm
 

Private Attributes

const CWalletpwallet
 

Static Private Attributes

static const uint256 ABANDON_HASH
 Constant used in hashBlock to indicate tx has been abandoned, only used at serialization/deserialization to avoid ambiguity with conflicted. More...
 

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

Member Enumeration Documentation

◆ AmountType

position in ordered transaction list

Enumerator
DEBIT 
CREDIT 
IMMATURE_CREDIT 
AVAILABLE_CREDIT 
AMOUNTTYPE_ENUM_ELEMENTS 

Definition at line 349 of file wallet.h.

◆ Status

Enumerator
UNCONFIRMED 
CONFIRMED 
CONFLICTED 
ABANDONED 

Definition at line 374 of file wallet.h.

Constructor & Destructor Documentation

◆ CWalletTx()

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

Definition at line 4751 of file wallet.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ AcceptToMemoryPool()

bool CWalletTx::AcceptToMemoryPool ( CValidationState state)

Pass this transaction to the mempool.

Fails if absolute fee exceeds absurd fee.

Todo:
: clean this setting the proper invalid state inside AcceptToMemoryPool (btc#15921).

Definition at line 4501 of file wallet.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ BindWallet()

void CWalletTx::BindWallet ( CWallet pwalletIn)

Definition at line 4846 of file wallet.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DecryptSaplingNote()

Optional< std::pair< libzcash::SaplingNotePlaintext, libzcash::SaplingPaymentAddress > > CWalletTx::DecryptSaplingNote ( const SaplingOutPoint op) const

Definition at line 4866 of file wallet.cpp.

Here is the caller graph for this function:

◆ GetBlocksToMaturity()

int CWalletTx::GetBlocksToMaturity ( ) const

Definition at line 4486 of file wallet.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetChange()

CAmount CWalletTx::GetChange ( ) const

Definition at line 4930 of file wallet.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetComment()

std::string CWalletTx::GetComment ( ) const
inline

Definition at line 482 of file wallet.h.

Here is the caller graph for this function:

◆ GetDepthAndMempool()

int CWalletTx::GetDepthAndMempool ( bool &  fConflicted) const

Definition at line 4817 of file wallet.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetDepthInMainChain()

int CWalletTx::GetDepthInMainChain ( ) 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.

Todo:
: Remove "NO_THREAD_SAFETY_ANALYSIS" and replace it with the correct

Definition at line 4477 of file wallet.cpp.

Here is the caller graph for this function:

◆ GetHash()

const uint256& CWalletTx::GetHash ( ) const
inline

Definition at line 561 of file wallet.h.

Here is the caller graph for this function:

◆ GetShieldedAvailableCredit()

CAmount CWalletTx::GetShieldedAvailableCredit ( bool  fUseCache = true) const

Definition at line 4954 of file wallet.cpp.

Here is the call graph for this function:

◆ GetShieldedChange()

CAmount CWalletTx::GetShieldedChange ( ) const

Definition at line 4939 of file wallet.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ HasP2CSInputs()

bool CWalletTx::HasP2CSInputs ( ) const

checks whether a tx has P2CS inputs or not

Definition at line 4925 of file wallet.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Init()

void CWalletTx::Init ( const CWallet pwalletIn)

Definition at line 4757 of file wallet.cpp.

Here is the caller graph for this function:

◆ isAbandoned()

bool CWalletTx::isAbandoned ( ) const
inline

Definition at line 546 of file wallet.h.

Here is the caller graph for this function:

◆ IsCoinBase()

bool CWalletTx::IsCoinBase ( ) const
inline

Definition at line 562 of file wallet.h.

Here is the caller graph for this function:

◆ IsCoinStake()

bool CWalletTx::IsCoinStake ( ) const
inline

Definition at line 563 of file wallet.h.

Here is the caller graph for this function:

◆ isConfirmed()

bool CWalletTx::isConfirmed ( ) const
inline

Definition at line 558 of file wallet.h.

◆ isConflicted()

bool CWalletTx::isConflicted ( ) const
inline

Definition at line 554 of file wallet.h.

◆ IsEquivalentTo()

bool CWalletTx::IsEquivalentTo ( const CWalletTx tx) const

Definition at line 4824 of file wallet.cpp.

◆ IsFromMe()

bool CWalletTx::IsFromMe ( const isminefilter filter) const

Definition at line 4949 of file wallet.cpp.

Here is the caller graph for this function:

◆ IsInMainChainImmature()

bool CWalletTx::IsInMainChainImmature ( ) const

Definition at line 4493 of file wallet.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsTrusted() [1/2]

bool CWalletTx::IsTrusted ( ) const

Definition at line 4777 of file wallet.cpp.

Here is the caller graph for this function:

◆ IsTrusted() [2/2]

bool CWalletTx::IsTrusted ( int &  nDepth,
bool &  fConflicted 
) const

Definition at line 4784 of file wallet.cpp.

Here is the call graph for this function:

◆ isUnconfirmed()

bool CWalletTx::isUnconfirmed ( ) const
inline

Definition at line 556 of file wallet.h.

◆ MarkDirty()

void CWalletTx::MarkDirty ( )

make sure balances are recalculated

Definition at line 4833 of file wallet.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RecoverSaplingNote()

Optional< std::pair< libzcash::SaplingNotePlaintext, libzcash::SaplingPaymentAddress > > CWalletTx::RecoverSaplingNote ( const SaplingOutPoint op,
const std::set< uint256 > &  ovks 
) const

Definition at line 4894 of file wallet.cpp.

Here is the call graph for this function:

◆ Serialize()

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

< Used to be vMerkleBranch

< Used to be vtxPrev

< Used to be fSpent

Definition at line 397 of file wallet.h.

◆ setAbandoned()

void CWalletTx::setAbandoned ( )
inline

Definition at line 547 of file wallet.h.

Here is the caller graph for this function:

◆ SetComment()

void CWalletTx::SetComment ( const std::string &  comment)
inline

Store a comment.

Definition at line 481 of file wallet.h.

◆ setConfirmed()

void CWalletTx::setConfirmed ( )
inline

Definition at line 559 of file wallet.h.

Here is the caller graph for this function:

◆ setConflicted()

void CWalletTx::setConflicted ( )
inline

Definition at line 555 of file wallet.h.

Here is the caller graph for this function:

◆ SetSaplingNoteData()

void CWalletTx::SetSaplingNoteData ( mapSaplingNoteData_t noteData)

Definition at line 4852 of file wallet.cpp.

Here is the caller graph for this function:

◆ SetTx()

void CWalletTx::SetTx ( CTransactionRef  arg)
inline

Definition at line 460 of file wallet.h.

◆ setUnconfirmed()

void CWalletTx::setUnconfirmed ( )
inline

Definition at line 557 of file wallet.h.

◆ Unserialize()

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

< Used to be vMerkleBranch

< Used to be vtxPrev

Used to be fSpent

Definition at line 420 of file wallet.h.

Here is the call graph for this function:

Member Data Documentation

◆ ABANDON_HASH

const uint256 CWalletTx::ABANDON_HASH
staticprivate

Constant used in hashBlock to indicate tx has been abandoned, only used at serialization/deserialization to avoid ambiguity with conflicted.

Definition at line 332 of file wallet.h.

◆ fChangeCached

bool CWalletTx::fChangeCached
mutable

Definition at line 355 of file wallet.h.

◆ fFromMe

char CWalletTx::fFromMe

Definition at line 345 of file wallet.h.

◆ fInMempool

bool CWalletTx::fInMempool
mutable

Definition at line 356 of file wallet.h.

◆ fShieldedChangeCached

bool CWalletTx::fShieldedChangeCached
mutable

Definition at line 358 of file wallet.h.

◆ fStakeDelegationVoided

bool CWalletTx::fStakeDelegationVoided
mutable

Definition at line 354 of file wallet.h.

◆ fTimeReceivedIsTxTime

unsigned int CWalletTx::fTimeReceivedIsTxTime

Definition at line 338 of file wallet.h.

◆ m_amounts

CachableAmount CWalletTx::m_amounts[AMOUNTTYPE_ENUM_ELEMENTS]
mutable

Definition at line 352 of file wallet.h.

◆ m_confirm

Confirmation CWalletTx::m_confirm

Definition at line 394 of file wallet.h.

◆ mapSaplingNoteData

mapSaplingNoteData_t CWalletTx::mapSaplingNoteData

Definition at line 336 of file wallet.h.

◆ mapValue

mapValue_t CWalletTx::mapValue

Definition at line 335 of file wallet.h.

◆ nChangeCached

CAmount CWalletTx::nChangeCached
mutable

Definition at line 357 of file wallet.h.

◆ nOrderPos

int64_t CWalletTx::nOrderPos

Definition at line 346 of file wallet.h.

◆ nShieldedChangeCached

CAmount CWalletTx::nShieldedChangeCached
mutable

Definition at line 359 of file wallet.h.

◆ nTimeReceived

unsigned int CWalletTx::nTimeReceived

Definition at line 339 of file wallet.h.

◆ nTimeSmart

unsigned int CWalletTx::nTimeSmart

time received by this node

Stable timestamp representing the block time, for a transaction included in a block, or else the time when the transaction was received if it isn't yet part of a block.

Definition at line 344 of file wallet.h.

◆ pwallet

const CWallet* CWalletTx::pwallet
private

Definition at line 327 of file wallet.h.

◆ tx

CTransactionRef CWalletTx::tx

Definition at line 364 of file wallet.h.

◆ vOrderForm

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

Definition at line 337 of file wallet.h.


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