Changeset View
Changeset View
Standalone View
Standalone View
src/qt/transactiondesc.cpp
Show First 20 Lines • Show All 84 Lines • ▼ Show 20 Lines | QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, | ||||
} 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 > 0) { | ||||
// Credit | // Credit | ||||
if (CBitcoinAddress(rec->address).IsValid()) { | if (IsValidDestinationString(rec->address)) { | ||||
CTxDestination address = CBitcoinAddress(rec->address).Get(); | CTxDestination address = DecodeDestination(rec->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); | ||||
QString addressOwned = | QString addressOwned = | ||||
(::IsMine(*wallet, address) == ISMINE_SPENDABLE) | (::IsMine(*wallet, address) == ISMINE_SPENDABLE) | ||||
? tr("own address") | ? tr("own address") | ||||
Show All 14 Lines | QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, | ||||
// | // | ||||
// To | // To | ||||
// | // | ||||
if (wtx.mapValue.count("to") && !wtx.mapValue["to"].empty()) { | if (wtx.mapValue.count("to") && !wtx.mapValue["to"].empty()) { | ||||
// Online transaction | // Online transaction | ||||
std::string strAddress = wtx.mapValue["to"]; | std::string strAddress = wtx.mapValue["to"]; | ||||
strHTML += "<b>" + tr("To") + ":</b> "; | strHTML += "<b>" + tr("To") + ":</b> "; | ||||
CTxDestination dest = CBitcoinAddress(strAddress).Get(); | CTxDestination dest = DecodeDestination(strAddress); | ||||
if (wallet->mapAddressBook.count(dest) && | if (wallet->mapAddressBook.count(dest) && | ||||
!wallet->mapAddressBook[dest].name.empty()) | !wallet->mapAddressBook[dest].name.empty()) | ||||
strHTML += | strHTML += | ||||
GUIUtil::HtmlEscape(wallet->mapAddressBook[dest].name) + " "; | GUIUtil::HtmlEscape(wallet->mapAddressBook[dest].name) + " "; | ||||
strHTML += GUIUtil::HtmlEscape(strAddress) + "<br>"; | strHTML += GUIUtil::HtmlEscape(strAddress) + "<br>"; | ||||
} | } | ||||
// | // | ||||
▲ Show 20 Lines • Show All 56 Lines • ▼ Show 20 Lines | if (wtx.IsCoinBase() && nCredit == 0) { | ||||
if (ExtractDestination(txout.scriptPubKey, address)) { | if (ExtractDestination(txout.scriptPubKey, address)) { | ||||
strHTML += "<b>" + tr("To") + ":</b> "; | strHTML += "<b>" + tr("To") + ":</b> "; | ||||
if (wallet->mapAddressBook.count(address) && | if (wallet->mapAddressBook.count(address) && | ||||
!wallet->mapAddressBook[address].name.empty()) | !wallet->mapAddressBook[address].name.empty()) | ||||
strHTML += | strHTML += | ||||
GUIUtil::HtmlEscape( | GUIUtil::HtmlEscape( | ||||
wallet->mapAddressBook[address].name) + | wallet->mapAddressBook[address].name) + | ||||
" "; | " "; | ||||
strHTML += GUIUtil::HtmlEscape( | strHTML += | ||||
CBitcoinAddress(address).ToString()); | GUIUtil::HtmlEscape(EncodeDestination(address)); | ||||
if (toSelf == ISMINE_SPENDABLE) | if (toSelf == ISMINE_SPENDABLE) | ||||
strHTML += " (own address)"; | strHTML += " (own address)"; | ||||
else if (toSelf & ISMINE_WATCH_ONLY) | else if (toSelf & ISMINE_WATCH_ONLY) | ||||
strHTML += " (watch-only)"; | strHTML += " (watch-only)"; | ||||
strHTML += "<br>"; | strHTML += "<br>"; | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 138 Lines • ▼ Show 20 Lines | if (fDebug) { | ||||
CTxDestination address; | CTxDestination address; | ||||
if (ExtractDestination(vout.scriptPubKey, address)) { | if (ExtractDestination(vout.scriptPubKey, address)) { | ||||
if (wallet->mapAddressBook.count(address) && | if (wallet->mapAddressBook.count(address) && | ||||
!wallet->mapAddressBook[address].name.empty()) { | !wallet->mapAddressBook[address].name.empty()) { | ||||
strHTML += GUIUtil::HtmlEscape( | strHTML += GUIUtil::HtmlEscape( | ||||
wallet->mapAddressBook[address].name) + | wallet->mapAddressBook[address].name) + | ||||
" "; | " "; | ||||
} | } | ||||
strHTML += QString::fromStdString( | strHTML += | ||||
CBitcoinAddress(address).ToString()); | QString::fromStdString(EncodeDestination(address)); | ||||
} | } | ||||
strHTML = strHTML + " " + tr("Amount") + "=" + | strHTML = strHTML + " " + tr("Amount") + "=" + | ||||
BitcoinUnits::formatHtmlWithUnit(unit, vout.nValue); | BitcoinUnits::formatHtmlWithUnit(unit, vout.nValue); | ||||
strHTML = | strHTML = | ||||
strHTML + " IsMine=" + | strHTML + " IsMine=" + | ||||
(wallet->IsMine(vout) & ISMINE_SPENDABLE ? tr("true") | (wallet->IsMine(vout) & ISMINE_SPENDABLE ? tr("true") | ||||
: tr("false")) + | : tr("false")) + | ||||
"</li>"; | "</li>"; | ||||
Show All 14 Lines |