Changeset View
Changeset View
Standalone View
Standalone View
src/qt/transactionrecord.cpp
Show First 20 Lines • Show All 84 Lines • ▼ Show 20 Lines | if (nNet > 0 || wtx.IsCoinBase()) { | ||||
for (const CTxOut &txout : wtx.tx->vout) { | for (const CTxOut &txout : wtx.tx->vout) { | ||||
isminetype mine = wallet->IsMine(txout); | isminetype mine = wallet->IsMine(txout); | ||||
if (mine & ISMINE_WATCH_ONLY) involvesWatchAddress = true; | if (mine & ISMINE_WATCH_ONLY) involvesWatchAddress = true; | ||||
if (fAllToMe > mine) fAllToMe = mine; | if (fAllToMe > mine) fAllToMe = mine; | ||||
} | } | ||||
if (fAllFromMe && fAllToMe) { | if (fAllFromMe && fAllToMe) { | ||||
// Payment to self | // Payment to self | ||||
CAmount nChange = wtx.GetChange().GetSatoshis(); | Amount nChange = wtx.GetChange(); | ||||
parts.append(TransactionRecord(hash, nTime, | parts.append(TransactionRecord(hash, nTime, | ||||
TransactionRecord::SendToSelf, "", | TransactionRecord::SendToSelf, "", | ||||
-(nDebit - nChange).GetSatoshis(), | -(nDebit - nChange).GetSatoshis(), | ||||
(nCredit - nChange).GetSatoshis())); | (nCredit - nChange).GetSatoshis())); | ||||
// maybe pass to TransactionRecord as constructor argument | // maybe pass to TransactionRecord as constructor argument | ||||
parts.last().involvesWatchAddress = involvesWatchAddress; | parts.last().involvesWatchAddress = involvesWatchAddress; | ||||
} else if (fAllFromMe) { | } else if (fAllFromMe) { | ||||
Show All 20 Lines | if (nNet > 0 || wtx.IsCoinBase()) { | ||||
sub.type = TransactionRecord::SendToAddress; | sub.type = TransactionRecord::SendToAddress; | ||||
sub.address = EncodeDestination(address); | sub.address = EncodeDestination(address); | ||||
} else { | } else { | ||||
// Sent to IP, or other non-address transaction like OP_EVAL | // Sent to IP, or other non-address transaction like OP_EVAL | ||||
sub.type = TransactionRecord::SendToOther; | sub.type = TransactionRecord::SendToOther; | ||||
sub.address = mapValue["to"]; | sub.address = mapValue["to"]; | ||||
} | } | ||||
CAmount nValue = txout.nValue.GetSatoshis(); | Amount nValue = txout.nValue; | ||||
/* Add fee to first output */ | /* Add fee to first output */ | ||||
if (nTxFee > 0) { | if (nTxFee > Amount(0)) { | ||||
nValue += nTxFee.GetSatoshis(); | nValue += nTxFee; | ||||
nTxFee = 0; | nTxFee = Amount(0); | ||||
} | } | ||||
sub.debit = -nValue; | sub.debit = -nValue.GetSatoshis(); | ||||
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( | ||||
▲ Show 20 Lines • Show All 83 Lines • Show Last 20 Lines |