Master Core  v0.0.9 - 2abfd2849db8ba7a83957c64eb976b406713c123
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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:
+ Collaboration diagram for CWalletTx:

Public Member Functions

 CWalletTx ()
 
 CWalletTx (const CWallet *pwalletIn)
 
 CWalletTx (const CWallet *pwalletIn, const CMerkleTx &txIn)
 
 CWalletTx (const CWallet *pwalletIn, const CTransaction &txIn)
 
void Init (const CWallet *pwalletIn)
 
 IMPLEMENT_SERIALIZE (CWalletTx *pthis=const_cast< CWalletTx * >(this);if(fRead) pthis->Init(NULL);char fSpent=false;if(!fRead){pthis->mapValue["fromaccount"]=pthis->strFromAccount;WriteOrderPos(pthis->nOrderPos, pthis->mapValue);if(nTimeSmart) pthis->mapValue["timesmart"]=strprintf("%u", nTimeSmart);}nSerSize+=SerReadWrite(s,*(CMerkleTx *) this, nType, nVersion, ser_action);std::vector< CMerkleTx > vUnused;READWRITE(vUnused);READWRITE(mapValue);READWRITE(vOrderForm);READWRITE(fTimeReceivedIsTxTime);READWRITE(nTimeReceived);READWRITE(fFromMe);READWRITE(fSpent);if(fRead){pthis->strFromAccount=pthis->mapValue["fromaccount"];ReadOrderPos(pthis->nOrderPos, pthis->mapValue);pthis->nTimeSmart=mapValue.count("timesmart")?(unsigned int) atoi64(pthis->mapValue["timesmart"]):0;}pthis->mapValue.erase("fromaccount");pthis->mapValue.erase("version");pthis->mapValue.erase("spent");pthis->mapValue.erase("n");pthis->mapValue.erase("timesmart");) void MarkDirty()
 
void BindWallet (CWallet *pwalletIn)
 
int64_t GetDebit () const
 
int64_t GetCredit (bool fUseCache=true) const
 
int64_t GetImmatureCredit (bool fUseCache=true) const
 
int64_t GetAvailableCredit (bool fUseCache=true) const
 
int64_t GetChange () const
 
void GetAmounts (std::list< std::pair< CTxDestination, int64_t > > &listReceived, std::list< std::pair< CTxDestination, int64_t > > &listSent, int64_t &nFee, std::string &strSentAccount) const
 
void GetAccountAmounts (const std::string &strAccount, int64_t &nReceived, int64_t &nSent, int64_t &nFee) const
 
bool IsFromMe () const
 
bool IsTrusted () const
 
bool WriteToDisk ()
 
int64_t GetTxTime () const
 
int GetRequestCount () const
 
void RelayWalletTransaction ()
 
std::set< uint256GetConflicts () const
 
- Public Member Functions inherited from CMerkleTx
 CMerkleTx ()
 
 CMerkleTx (const CTransaction &txIn)
 
void Init ()
 
 IMPLEMENT_SERIALIZE (nSerSize+=SerReadWrite(s,*(CTransaction *) this, nType, nVersion, ser_action);nVersion=this->nVersion;READWRITE(hashBlock);READWRITE(vMerkleBranch);READWRITE(nIndex);) int SetMerkleBranch(const CBlock *pblock
 
int GetDepthInMainChain (CBlockIndex *&pindexRet) const
 
int GetDepthInMainChain () const
 
bool IsInMainChain () const
 
int GetBlocksToMaturity () const
 
bool AcceptToMemoryPool (bool fLimitFree=true)
 
- Public Member Functions inherited from CTransaction
 CTransaction ()
 
 IMPLEMENT_SERIALIZE (READWRITE(this->nVersion);nVersion=this->nVersion;READWRITE(vin);READWRITE(vout);READWRITE(nLockTime);) void SetNull()
 
bool IsNull () const
 
uint256 GetHash () const
 
bool IsNewerThan (const CTransaction &old) const
 
int64_t GetValueOut () const
 
double ComputePriority (double dPriorityInputs, unsigned int nTxSize=0) const
 
bool IsCoinBase () const
 
std::string ToString () const
 
void print () const
 

Public Attributes

mapValue_t mapValue
 
std::vector< std::pair< std::string, std::string > > vOrderForm
 
unsigned int fTimeReceivedIsTxTime
 
unsigned int nTimeReceived
 
unsigned int nTimeSmart
 
char fFromMe
 
std::string strFromAccount
 
int64_t nOrderPos
 
bool fDebitCached
 
bool fCreditCached
 
bool fImmatureCreditCached
 
bool fAvailableCreditCached
 
bool fChangeCached
 
int64_t nDebitCached
 
int64_t nCreditCached
 
int64_t nImmatureCreditCached
 
int64_t nAvailableCreditCached
 
int64_t nChangeCached
 
- Public Attributes inherited from CMerkleTx
uint256 hashBlock
 
std::vector< uint256vMerkleBranch
 
int nIndex
 
bool fMerkleVerified
 
- Public Attributes inherited from CTransaction
int nVersion
 
std::vector< CTxInvin
 
std::vector< CTxOutvout
 
unsigned int nLockTime
 

Private Attributes

const CWalletpwallet
 

Additional Inherited Members

- Static Public Attributes inherited from CTransaction
static int64_t nMinTxFee = 10000
 Fees smaller than this (in satoshi) are considered zero fee (for transaction creation) More...
 
static int64_t nMinRelayTxFee = 1000
 Fees smaller than this (in satoshi) are considered zero fee (for relaying and mining) More...
 
static const int CURRENT_VERSION =1
 

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

Constructor & Destructor Documentation

CWalletTx::CWalletTx ( )
inline

Definition at line 478 of file wallet.h.

CWalletTx::CWalletTx ( const CWallet pwalletIn)
inline

Definition at line 483 of file wallet.h.

CWalletTx::CWalletTx ( const CWallet pwalletIn,
const CMerkleTx txIn 
)
inline

Definition at line 488 of file wallet.h.

CWalletTx::CWalletTx ( const CWallet pwalletIn,
const CTransaction txIn 
)
inline

Definition at line 493 of file wallet.h.

Member Function Documentation

void CWalletTx::BindWallet ( CWallet pwalletIn)
inline

Definition at line 573 of file wallet.h.

Referenced by CWallet::AddToWallet(), and CWallet::CommitTransaction().

+ Here is the caller graph for this function:

void CWalletTx::GetAccountAmounts ( const std::string &  strAccount,
int64_t &  nReceived,
int64_t &  nSent,
int64_t &  nFee 
) const

Definition at line 803 of file wallet.cpp.

References LOCK, and PAIRTYPE.

Referenced by GetAccountBalance().

+ Here is the caller graph for this function:

void CWalletTx::GetAmounts ( std::list< std::pair< CTxDestination, int64_t > > &  listReceived,
std::list< std::pair< CTxDestination, int64_t > > &  listSent,
int64_t &  nFee,
std::string &  strSentAccount 
) const

Definition at line 750 of file wallet.cpp.

References ExtractDestination(), LogPrintf, CTxOut::nValue, and CTxOut::scriptPubKey.

Referenced by getbalance(), listaccounts(), and ListTransactions().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int64_t CWalletTx::GetAvailableCredit ( bool  fUseCache = true) const
inline

Definition at line 618 of file wallet.h.

References CWallet::GetCredit(), CWallet::IsSpent(), and MoneyRange().

Referenced by CWallet::GetBalance(), CWallet::GetUnconfirmedBalance(), and selectCoins().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int64_t CWalletTx::GetChange ( ) const
inline

Definition at line 649 of file wallet.h.

References CWallet::GetChange().

Referenced by TransactionRecord::decomposeTransaction(), and TransactionDesc::toHTML().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

set< uint256 > CWalletTx::GetConflicts ( ) const

Definition at line 919 of file wallet.cpp.

Referenced by WalletTxToJSON().

+ Here is the caller graph for this function:

int64_t CWalletTx::GetCredit ( bool  fUseCache = true) const
inline

Definition at line 590 of file wallet.h.

References CWallet::GetCredit().

Referenced by TransactionRecord::decomposeTransaction(), gettransaction(), and TransactionDesc::toHTML().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int64_t CWalletTx::GetDebit ( ) const
inline

Definition at line 579 of file wallet.h.

References CWallet::GetDebit().

Referenced by TransactionRecord::decomposeTransaction(), gettransaction(), and TransactionDesc::toHTML().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int64_t CWalletTx::GetImmatureCredit ( bool  fUseCache = true) const
inline

Definition at line 604 of file wallet.h.

References CWallet::GetCredit().

Referenced by CWallet::GetImmatureBalance().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int CWalletTx::GetRequestCount ( ) const

Definition at line 711 of file wallet.cpp.

References LOCK.

Referenced by TransactionDesc::FormatTxStatus(), TransactionDesc::toHTML(), and TransactionRecord::updateStatus().

+ Here is the caller graph for this function:

int64_t CWalletTx::GetTxTime ( ) const

Definition at line 705 of file wallet.cpp.

Referenced by TransactionRecord::decomposeTransaction(), TransactionDesc::toHTML(), CoinControlDialog::updateView(), and WalletTxToJSON().

+ Here is the caller graph for this function:

CWalletTx::IMPLEMENT_SERIALIZE ( CWalletTx pthis = const_cast<CWalletTx*>(this); if (fRead) pthis->Init(NULL); char fSpent = false; if (!fRead) { pthis->mapValue["fromaccount"] = pthis->strFromAccountWriteOrderPos(pthis->nOrderPos, pthis->mapValue); if (nTimeSmart) pthis->mapValue["timesmart"] = strprintf("%u", nTimeSmart); } nSerSize += SerReadWrite(s, *(CMerkleTx*)this, nType, nVersion,ser_action); std::vector<CMerkleTx> vUnused;  READWRITE(vUnused); READWRITE(mapValue); READWRITE(vOrderForm); READWRITE(fTimeReceivedIsTxTime); READWRITE(nTimeReceived); READWRITE(fFromMe); READWRITE(fSpent); if (fRead) { pthis->strFromAccount = pthis->mapValue["fromaccount"]; ReadOrderPos(pthis->nOrderPos, pthis->mapValue); pthis->nTimeSmart = mapValue.count("timesmart") ? (unsigned int)atoi64(pthis->mapValue["timesmart"]) : 0; } pthis->mapValue.erase("fromaccount"); pthis->mapValue.erase("version"); pthis->mapValue.erase("spent"); pthis->mapValue.erase("n"); pthis->mapValue.erase("timesmart");)
inline

Definition at line 522 of file wallet.h.

References strprintf, and WriteOrderPos().

+ Here is the call graph for this function:

void CWalletTx::Init ( const CWallet pwalletIn)
inline

Definition at line 498 of file wallet.h.

bool CWalletTx::IsFromMe ( ) const
inline

Definition at line 664 of file wallet.h.

Referenced by CWallet::GetAddressBalances(), gettransaction(), and CWallet::SelectCoinsMinConf().

+ Here is the caller graph for this function:

bool CWalletTx::IsTrusted ( ) const
inline

Definition at line 669 of file wallet.h.

References bSpendZeroConfChange, CWallet::GetWalletTx(), COutPoint::hash, IsFinalTx(), CWallet::IsMine(), COutPoint::n, CTxIn::prevout, and CTransaction::vout.

Referenced by CWallet::AvailableCoins(), CWallet::GetAddressBalances(), CWallet::GetBalance(), getbalance(), CWallet::GetUnconfirmedBalance(), selectCoins(), and TransactionRecord::updateStatus().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void CWalletTx::RelayWalletTransaction ( )

Definition at line 907 of file wallet.cpp.

References LogPrintf, RelayTransaction(), and base_uint< BITS >::ToString().

Referenced by CWallet::CommitTransaction(), and CWallet::ResendWalletTransactions().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool CWalletTx::WriteToDisk ( )

Definition at line 839 of file wallet.cpp.

References CWalletDB::WriteTx().

Referenced by CWallet::AddToWallet().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

bool CWalletTx::fAvailableCreditCached
mutable

Definition at line 470 of file wallet.h.

bool CWalletTx::fChangeCached
mutable

Definition at line 471 of file wallet.h.

bool CWalletTx::fCreditCached
mutable

Definition at line 468 of file wallet.h.

bool CWalletTx::fDebitCached
mutable

Definition at line 467 of file wallet.h.

char CWalletTx::fFromMe

Definition at line 462 of file wallet.h.

Referenced by CWallet::AddToWallet(), and CWallet::SyncMetaData().

bool CWalletTx::fImmatureCreditCached
mutable

Definition at line 469 of file wallet.h.

unsigned int CWalletTx::fTimeReceivedIsTxTime

Definition at line 459 of file wallet.h.

mapValue_t CWalletTx::mapValue
int64_t CWalletTx::nAvailableCreditCached
mutable

Definition at line 475 of file wallet.h.

int64_t CWalletTx::nChangeCached
mutable

Definition at line 476 of file wallet.h.

int64_t CWalletTx::nCreditCached
mutable

Definition at line 473 of file wallet.h.

int64_t CWalletTx::nDebitCached
mutable

Definition at line 472 of file wallet.h.

int64_t CWalletTx::nImmatureCreditCached
mutable

Definition at line 474 of file wallet.h.

int64_t CWalletTx::nOrderPos
unsigned int CWalletTx::nTimeReceived
unsigned int CWalletTx::nTimeSmart

Definition at line 461 of file wallet.h.

Referenced by CWallet::AddToWallet(), and CWallet::SyncMetaData().

const CWallet* CWalletTx::pwallet
private

Definition at line 454 of file wallet.h.

std::string CWalletTx::strFromAccount

Definition at line 463 of file wallet.h.

Referenced by sendfrom(), sendmany(), and CWallet::SyncMetaData().

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

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