Changeset View
Changeset View
Standalone View
Standalone View
src/qt/transactiondesc.cpp
Show First 20 Lines • Show All 82 Lines • ▼ Show 20 Lines | QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, | ||||
if (wtx.IsCoinBase()) { | if (wtx.IsCoinBase()) { | ||||
strHTML += "<b>" + tr("Source") + ":</b> " + tr("Generated") + "<br>"; | strHTML += "<b>" + tr("Source") + ":</b> " + tr("Generated") + "<br>"; | ||||
} else if (wtx.mapValue.count("from") && !wtx.mapValue["from"].empty()) { | } else if (wtx.mapValue.count("from") && !wtx.mapValue["from"].empty()) { | ||||
// Online transaction | // Online transaction | ||||
strHTML += "<b>" + tr("From") + ":</b> " + | strHTML += "<b>" + tr("From") + ":</b> " + | ||||
GUIUtil::HtmlEscape(wtx.mapValue["from"]) + "<br>"; | GUIUtil::HtmlEscape(wtx.mapValue["from"]) + "<br>"; | ||||
} else { | } else { | ||||
// Offline transaction | // Offline transaction | ||||
if (nNet > 0) { | if (nNet > Amount(0)) { | ||||
// Credit | // Credit | ||||
CTxDestination address = DecodeDestination(rec->address); | CTxDestination address = DecodeDestination(rec->address); | ||||
if (IsValidDestination(address)) { | if (IsValidDestination(address)) { | ||||
if (wallet->mapAddressBook.count(address)) { | if (wallet->mapAddressBook.count(address)) { | ||||
strHTML += | strHTML += | ||||
"<b>" + tr("From") + ":</b> " + tr("unknown") + "<br>"; | "<b>" + tr("From") + ":</b> " + tr("unknown") + "<br>"; | ||||
strHTML += "<b>" + tr("To") + ":</b> "; | strHTML += "<b>" + tr("To") + ":</b> "; | ||||
strHTML += GUIUtil::HtmlEscape(rec->address); | strHTML += GUIUtil::HtmlEscape(rec->address); | ||||
▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | if (wtx.IsCoinBase() && nCredit == Amount(0)) { | ||||
if (wtx.IsInMainChain()) | if (wtx.IsInMainChain()) | ||||
strHTML += BitcoinUnits::formatHtmlWithUnit(unit, nUnmatured) + | strHTML += BitcoinUnits::formatHtmlWithUnit(unit, nUnmatured) + | ||||
" (" + tr("matures in %n more block(s)", "", | " (" + tr("matures in %n more block(s)", "", | ||||
wtx.GetBlocksToMaturity()) + | wtx.GetBlocksToMaturity()) + | ||||
")"; | ")"; | ||||
else | else | ||||
strHTML += "(" + tr("not accepted") + ")"; | strHTML += "(" + tr("not accepted") + ")"; | ||||
strHTML += "<br>"; | strHTML += "<br>"; | ||||
} else if (nNet > 0) { | } else if (nNet > Amount(0)) { | ||||
// | // | ||||
// Credit | // Credit | ||||
// | // | ||||
strHTML += "<b>" + tr("Credit") + ":</b> " + | strHTML += "<b>" + tr("Credit") + ":</b> " + | ||||
BitcoinUnits::formatHtmlWithUnit(unit, nNet) + "<br>"; | BitcoinUnits::formatHtmlWithUnit(unit, nNet) + "<br>"; | ||||
} else { | } else { | ||||
isminetype fAllFromMe = ISMINE_SPENDABLE; | isminetype fAllFromMe = ISMINE_SPENDABLE; | ||||
for (const CTxIn &txin : wtx.tx->vin) { | for (const CTxIn &txin : wtx.tx->vin) { | ||||
▲ Show 20 Lines • Show All 217 Lines • Show Last 20 Lines |