Changeset View
Changeset View
Standalone View
Standalone View
src/qt/transactiondesc.cpp
Show First 20 Lines • Show All 94 Lines • ▼ Show 20 Lines | if (wtx.is_coinbase) { | ||||
// Offline transaction | // Offline transaction | ||||
if (nNet > Amount::zero()) { | if (nNet > Amount::zero()) { | ||||
// Credit | // Credit | ||||
CTxDestination address = | CTxDestination address = | ||||
DecodeDestination(rec->address, wallet.getChainParams()); | DecodeDestination(rec->address, wallet.getChainParams()); | ||||
if (IsValidDestination(address)) { | if (IsValidDestination(address)) { | ||||
std::string name; | std::string name; | ||||
isminetype ismine; | isminetype ismine; | ||||
if (wallet.getAddress(address, &name, &ismine)) { | if (wallet.getAddress(address, &name, &ismine, | ||||
/* purpose= */ nullptr)) { | |||||
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 = ismine == ISMINE_SPENDABLE | QString addressOwned = ismine == ISMINE_SPENDABLE | ||||
? tr("own address") | ? tr("own address") | ||||
: tr("watch-only"); | : tr("watch-only"); | ||||
if (!name.empty()) { | if (!name.empty()) { | ||||
Show All 13 Lines | QString TransactionDesc::toHTML(interfaces::Node &node, | ||||
// | // | ||||
if (wtx.value_map.count("to") && !wtx.value_map["to"].empty()) { | if (wtx.value_map.count("to") && !wtx.value_map["to"].empty()) { | ||||
// Online transaction | // Online transaction | ||||
std::string strAddress = wtx.value_map["to"]; | std::string strAddress = wtx.value_map["to"]; | ||||
strHTML += "<b>" + tr("To") + ":</b> "; | strHTML += "<b>" + tr("To") + ":</b> "; | ||||
CTxDestination dest = | CTxDestination dest = | ||||
DecodeDestination(strAddress, wallet.getChainParams()); | DecodeDestination(strAddress, wallet.getChainParams()); | ||||
std::string name; | std::string name; | ||||
if (wallet.getAddress(dest, &name) && !name.empty()) { | if (wallet.getAddress(dest, &name, /* is_mine= */ nullptr, | ||||
/* purpose= */ nullptr) && | |||||
!name.empty()) { | |||||
strHTML += GUIUtil::HtmlEscape(name) + " "; | strHTML += GUIUtil::HtmlEscape(name) + " "; | ||||
} | } | ||||
strHTML += GUIUtil::HtmlEscape(strAddress) + "<br>"; | strHTML += GUIUtil::HtmlEscape(strAddress) + "<br>"; | ||||
} | } | ||||
// | // | ||||
// Amount | // Amount | ||||
// | // | ||||
▲ Show 20 Lines • Show All 56 Lines • ▼ Show 20 Lines | if (wtx.is_coinbase && nCredit == Amount::zero()) { | ||||
} | } | ||||
if (!wtx.value_map.count("to") || wtx.value_map["to"].empty()) { | if (!wtx.value_map.count("to") || wtx.value_map["to"].empty()) { | ||||
// Offline transaction | // Offline transaction | ||||
CTxDestination address; | CTxDestination address; | ||||
if (ExtractDestination(txout.scriptPubKey, address)) { | if (ExtractDestination(txout.scriptPubKey, address)) { | ||||
strHTML += "<b>" + tr("To") + ":</b> "; | strHTML += "<b>" + tr("To") + ":</b> "; | ||||
std::string name; | std::string name; | ||||
if (wallet.getAddress(address, &name) && | if (wallet.getAddress(address, &name, | ||||
/* is_mine= */ nullptr, | |||||
/* purpose= */ nullptr) && | |||||
!name.empty()) { | !name.empty()) { | ||||
strHTML += GUIUtil::HtmlEscape(name) + " "; | strHTML += GUIUtil::HtmlEscape(name) + " "; | ||||
} | } | ||||
strHTML += GUIUtil::HtmlEscape( | strHTML += GUIUtil::HtmlEscape( | ||||
EncodeCashAddr(address, wallet.getChainParams())); | EncodeCashAddr(address, wallet.getChainParams())); | ||||
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) { | ||||
▲ Show 20 Lines • Show All 154 Lines • ▼ Show 20 Lines | if (gArgs.GetBoolArg("-debug", false)) { | ||||
Coin prev; | Coin prev; | ||||
if (node.getUnspentOutput(prevout, prev)) { | if (node.getUnspentOutput(prevout, prev)) { | ||||
strHTML += "<li>"; | strHTML += "<li>"; | ||||
const CTxOut &vout = prev.GetTxOut(); | const CTxOut &vout = prev.GetTxOut(); | ||||
CTxDestination address; | CTxDestination address; | ||||
if (ExtractDestination(vout.scriptPubKey, address)) { | if (ExtractDestination(vout.scriptPubKey, address)) { | ||||
std::string name; | std::string name; | ||||
if (wallet.getAddress(address, &name) && !name.empty()) { | if (wallet.getAddress(address, &name, | ||||
/* is_mine= */ nullptr, | |||||
/* purpose= */ nullptr) && | |||||
!name.empty()) { | |||||
strHTML += GUIUtil::HtmlEscape(name) + " "; | strHTML += GUIUtil::HtmlEscape(name) + " "; | ||||
} | } | ||||
strHTML += QString::fromStdString( | strHTML += QString::fromStdString( | ||||
EncodeCashAddr(address, wallet.getChainParams())); | EncodeCashAddr(address, wallet.getChainParams())); | ||||
} | } | ||||
strHTML = strHTML + " " + tr("Amount") + "=" + | strHTML = strHTML + " " + tr("Amount") + "=" + | ||||
BitcoinUnits::formatHtmlWithUnit(unit, vout.nValue); | BitcoinUnits::formatHtmlWithUnit(unit, vout.nValue); | ||||
strHTML = strHTML + " IsMine=" + | strHTML = strHTML + " IsMine=" + | ||||
Show All 18 Lines |