Changeset View
Changeset View
Standalone View
Standalone View
src/qt/transactionrecord.cpp
Show All 34 Lines | TransactionRecord::decomposeTransaction(const CWallet *wallet, | ||||
QList<TransactionRecord> parts; | QList<TransactionRecord> parts; | ||||
int64_t nTime = wtx.GetTxTime(); | int64_t nTime = wtx.GetTxTime(); | ||||
Amount nCredit = wtx.GetCredit(ISMINE_ALL); | Amount nCredit = wtx.GetCredit(ISMINE_ALL); | ||||
Amount nDebit = wtx.GetDebit(ISMINE_ALL); | Amount nDebit = wtx.GetDebit(ISMINE_ALL); | ||||
Amount nNet = nCredit - nDebit; | Amount nNet = nCredit - nDebit; | ||||
uint256 hash = wtx.GetId(); | uint256 hash = wtx.GetId(); | ||||
std::map<std::string, std::string> mapValue = wtx.mapValue; | std::map<std::string, std::string> mapValue = wtx.mapValue; | ||||
if (nNet > 0 || wtx.IsCoinBase()) { | if (nNet > Amount(0) || wtx.IsCoinBase()) { | ||||
// | // | ||||
// Credit | // Credit | ||||
// | // | ||||
for (unsigned int i = 0; i < wtx.tx->vout.size(); i++) { | for (unsigned int i = 0; i < wtx.tx->vout.size(); i++) { | ||||
const CTxOut &txout = wtx.tx->vout[i]; | const CTxOut &txout = wtx.tx->vout[i]; | ||||
isminetype mine = wallet->IsMine(txout); | isminetype mine = wallet->IsMine(txout); | ||||
if (mine) { | if (mine) { | ||||
TransactionRecord sub(hash, nTime); | TransactionRecord sub(hash, nTime); | ||||
▲ Show 20 Lines • Show All 84 Lines • ▼ Show 20 Lines | if (nNet > Amount(0) || wtx.IsCoinBase()) { | ||||
parts.append(sub); | parts.append(sub); | ||||
} | } | ||||
} else { | } else { | ||||
// | // | ||||
// Mixed debit transaction, can't break down payees | // Mixed debit transaction, can't break down payees | ||||
// | // | ||||
parts.append(TransactionRecord( | parts.append(TransactionRecord( | ||||
hash, nTime, TransactionRecord::Other, "", nNet, 0)); | hash, nTime, TransactionRecord::Other, "", nNet, Amount(0))); | ||||
parts.last().involvesWatchAddress = involvesWatchAddress; | parts.last().involvesWatchAddress = involvesWatchAddress; | ||||
} | } | ||||
} | } | ||||
return parts; | return parts; | ||||
} | } | ||||
void TransactionRecord::updateStatus(const CWalletTx &wtx) { | void TransactionRecord::updateStatus(const CWalletTx &wtx) { | ||||
▲ Show 20 Lines • Show All 74 Lines • Show Last 20 Lines |