10 #include "validation.h" 19 #include <boost/foreach.hpp> 41 QList<TransactionRecord> parts;
45 CAmount nNet = nCredit - nDebit;
47 std::map<std::string, std::string> mapValue = wtx.
mapValue;
61 sub.
idx = parts.size();
88 bool fAllFromMeDenom =
true;
92 BOOST_FOREACH(
const CTxIn& txin, wtx.
vin)
95 fAllFromMeDenom = fAllFromMeDenom &&
wallet->IsDenominated(txin.
prevout);
100 if(fAllFromMe > mine) fAllFromMe = mine;
104 bool fAllToMeDenom =
true;
106 BOOST_FOREACH(
const CTxOut& txout, wtx.
vout) {
107 if(
wallet->IsMine(txout)) {
108 fAllToMeDenom = fAllToMeDenom &&
wallet->IsDenominatedAmount(txout.
nValue);
113 if(fAllToMe > mine) fAllToMe = mine;
116 if(fAllFromMeDenom && fAllToMeDenom && nFromMe * nToMe) {
118 parts.last().involvesWatchAddress =
false;
120 else if (fAllFromMe && fAllToMe)
131 if(mapValue[
"DS"] ==
"1")
148 for (
unsigned int nOut = 0; nOut < wtx.
vout.size(); nOut++)
151 sub.
idx = parts.size();
161 sub.
debit = -(nDebit - nChange);
162 sub.
credit = nCredit - nChange;
173 for (
unsigned int nOut = 0; nOut < wtx.
vout.size(); nOut++)
177 sub.
idx = parts.size();
201 if(mapValue[
"DS"] ==
"1")
240 pindex = (*mi).second;
244 (pindex ? pindex->
nHeight : std::numeric_limits<int>::max()),
void updateStatus(const CWalletTx &wtx)
CAmount GetCredit(const isminefilter &filter) const
boost::variant< CNoDestination, CKeyID, CScriptID > CTxDestination
bool ExtractDestination(const CScript &scriptPubKey, CTxDestination &addressRet)
Normal (sent/received) transactions.
static bool showTransaction(const CWalletTx &wtx)
isminetype IsMine(const CKeyStore &keystore, const CTxDestination &dest)
std::string sortKey
Sorting key based on status.
bool statusUpdateNeeded()
static CAmount GetCollateralAmount()
CAmount GetValueOut() const
unsigned int nTimeReceived
CAmount GetChange() const
bool IsInMainChain() const
std::string ToString() const
#define AssertLockHeld(cs)
bool involvesWatchAddress
bool CheckFinalTx(const CTransaction &tx, int flags)
int64_t GetTxTime() const
static QList< TransactionRecord > decomposeTransaction(const CWallet *wallet, const CWalletTx &wtx)
static const int RecommendedNumConfirmations
CAmount GetDebit(const isminefilter &filter) const
filter decides which addresses will count towards the debit
std::string ToString() const
const std::vector< CTxIn > vin
Generated (mined) transactions.
static QString formatSubTxId(const uint256 &hash, int vout)
const uint256 & GetHash() const
int64_t GetAdjustedTime()
const std::vector< CTxOut > vout
bool countsForBalance
Transaction counts towards available balance.
static const unsigned int LOCKTIME_THRESHOLD
int nHeight
height of the entry in the chain. The genesis block has height 0
int GetBlocksToMaturity() const
int GetDepthInMainChain(const CBlockIndex *&pindexRet, bool enableIX=true) const
int GetRequestCount() const