Changeset View
Changeset View
Standalone View
Standalone View
src/qt/transactiondesc.cpp
// Copyright (c) 2011-2016 The Bitcoin Core developers | // Copyright (c) 2011-2016 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#include <qt/transactiondesc.h> | #include <qt/transactiondesc.h> | ||||
#include <cashaddrenc.h> | |||||
#include <chain.h> | #include <chain.h> | ||||
#include <consensus/consensus.h> | #include <consensus/consensus.h> | ||||
#include <dstencode.h> | #include <dstencode.h> | ||||
#include <interfaces/node.h> | #include <interfaces/node.h> | ||||
#include <qt/bitcoinunits.h> | #include <qt/bitcoinunits.h> | ||||
#include <qt/guiutil.h> | #include <qt/guiutil.h> | ||||
#include <qt/paymentserver.h> | #include <qt/paymentserver.h> | ||||
#include <qt/transactionrecord.h> | #include <qt/transactionrecord.h> | ||||
▲ Show 20 Lines • Show All 185 Lines • ▼ Show 20 Lines | if (wtx.is_coinbase && nCredit == Amount::zero()) { | ||||
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) && | ||||
!name.empty()) { | !name.empty()) { | ||||
strHTML += GUIUtil::HtmlEscape(name) + " "; | strHTML += GUIUtil::HtmlEscape(name) + " "; | ||||
} | } | ||||
strHTML += | strHTML += GUIUtil::HtmlEscape( | ||||
GUIUtil::HtmlEscape(EncodeDestination(address)); | 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) { | ||||
strHTML += " (watch-only)"; | strHTML += " (watch-only)"; | ||||
} | } | ||||
strHTML += "<br>"; | strHTML += "<br>"; | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 148 Lines • ▼ Show 20 Lines | if (gArgs.GetBoolArg("-debug", false)) { | ||||
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) && !name.empty()) { | ||||
strHTML += GUIUtil::HtmlEscape(name) + " "; | strHTML += GUIUtil::HtmlEscape(name) + " "; | ||||
} | } | ||||
strHTML += | strHTML += QString::fromStdString( | ||||
QString::fromStdString(EncodeDestination(address)); | 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=" + | ||||
(wallet.txoutIsMine(vout) & ISMINE_SPENDABLE | (wallet.txoutIsMine(vout) & ISMINE_SPENDABLE | ||||
? tr("true") | ? tr("true") | ||||
: tr("false")) + | : tr("false")) + | ||||
"</li>"; | "</li>"; | ||||
Show All 14 Lines |