9 #include "validation.h"
15 #include <boost/foreach.hpp>
37 QList<TransactionRecord> parts;
41 CAmount nNet = nCredit - nDebit;
43 std::map<std::string, std::string> mapValue = wtx.
mapValue;
50 for(
unsigned int i = 0; i < wtx.
tx->vout.size(); i++)
52 const CTxOut& txout = wtx.
tx->vout[i];
87 BOOST_FOREACH(
const CTxIn& txin, wtx.
tx->vin)
91 if(fAllFromMe > mine) fAllFromMe = mine;
95 BOOST_FOREACH(
const CTxOut& txout, wtx.
tx->vout)
99 if(fAllToMe > mine) fAllToMe = mine;
102 if (fAllFromMe && fAllToMe)
108 -(nDebit - nChange), nCredit - nChange));
116 CAmount nTxFee = nDebit - wtx.
tx->GetValueOut();
118 for (
unsigned int nOut = 0; nOut < wtx.
tx->vout.size(); nOut++)
120 const CTxOut& txout = wtx.
tx->vout[nOut];
180 pindex = (*mi).second;
184 (pindex ? pindex->
nHeight : std::numeric_limits<int>::max()),
194 if (wtx.
tx->nLockTime < LOCKTIME_THRESHOLD)
int64_t CAmount
Amount in satoshis (Can be negative)
std::string ToString() const
base58-encoded Bitcoin addresses.
The block chain is a tree shaped structure starting with the genesis block at the root,...
int nHeight
height of the entry in the chain. The genesis block has height 0
int Height() const
Return the maximal height in the chain.
int GetDepthInMainChain(const CBlockIndex *&pindexRet) const
Return depth of transaction in blockchain: <0 : conflicts with a transaction this deep in the blockch...
const uint256 & GetHash() const
int GetBlocksToMaturity() const
bool IsInMainChain() const
An input of a transaction.
An output of a transaction.
A CWallet is an extension of a keystore, which also maintains a set of transactions and balances,...
A transaction with a bunch of additional info that only the owner cares about.
unsigned int nTimeReceived
time received by this node
UI model for a transaction.
int idx
Subtransaction index, for sort key.
static const int RecommendedNumConfirmations
Number of confirmation recommended for accepting a transaction.
TransactionStatus status
Status: can change with block chain update.
int getOutputIndex() const
Return the output index of the subtransaction
static bool showTransaction(const CWalletTx &wtx)
Decompose CWallet transaction to model transaction records.
QString getTxID() const
Return the unique identifier for this transaction (part)
void updateStatus(const CWalletTx &wtx)
Update status from core wallet tx.
static QList< TransactionRecord > decomposeTransaction(const CWallet *wallet, const CWalletTx &wtx)
bool statusUpdateNeeded()
Return whether a status update is needed.
bool involvesWatchAddress
Whether the transaction was sent/received with a watch-only address.
bool countsForBalance
Transaction counts towards available balance.
int cur_num_blocks
Current number of blocks (to know whether cached status is still valid)
qint64 open_for
Timestamp if status==OpenUntilDate, otherwise number of additional blocks that need to be mined befor...
@ MaturesWarning
Transaction will likely not mature because no nodes have confirmed.
@ Confirmed
Have 6 or more confirmations (normal tx) or fully mature (mined tx)
@ OpenUntilDate
Normal (sent/received) transactions.
@ Unconfirmed
Not yet mined into a block.
@ Immature
Generated (mined) transactions.
@ Confirming
Confirmed, but waiting for the recommended number of confirmations.
@ NotAccepted
Mined but not accepted.
@ OpenUntilBlock
Transaction not yet final, waiting for block.
@ Conflicted
Conflicts with other transaction or mempool.
@ Abandoned
Abandoned from the wallet.
@ Offline
Not sent to any other nodes.
std::string sortKey
Sorting key based on status.
std::string ToString() const
CAmount GetCredit(const isminefilter &filter) const
isminetype IsMine(const CTxIn &txin) const
CAmount GetChange() const
CAmount GetDebit(const isminefilter &filter) const
filter decides which addresses will count towards the debit
int64_t GetTxTime() const
int GetRequestCount() const
isminetype IsMine(const CKeyStore &keystore, const CScript &scriptPubKey, SigVersion sigversion)
isminetype
IsMine() return codes.
bool ExtractDestination(const CScript &scriptPubKey, CTxDestination &addressRet)
boost::variant< CNoDestination, CKeyID, CScriptID > CTxDestination
A txout script template with a specific destination.
#define AssertLockHeld(cs)
int64_t GetAdjustedTime()
CCriticalSection cs_main
Global state.
bool CheckFinalTx(const CTransaction &tx, int flags)
Check if transaction will be final in the next block to be created.
CChain chainActive
The currently-connected chain of blocks (protected by cs_main).