Browse Source

Merge #7761: [Qt] remove trailing output-index from transaction-id

7d5e31a [Qt] remove trailing output-index from transaction-id (Jonas Schnelli)
0.13
Wladimir J. van der Laan 9 years ago
parent
commit
60db51dcb2
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
  1. 3
      src/qt/transactiondesc.cpp
  2. 7
      src/qt/transactionrecord.cpp
  3. 4
      src/qt/transactionrecord.h

3
src/qt/transactiondesc.cpp

@ -240,7 +240,8 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, TransactionReco @@ -240,7 +240,8 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, TransactionReco
if (wtx.mapValue.count("comment") && !wtx.mapValue["comment"].empty())
strHTML += "<br><b>" + tr("Comment") + ":</b><br>" + GUIUtil::HtmlEscape(wtx.mapValue["comment"], true) + "<br>";
strHTML += "<b>" + tr("Transaction ID") + ":</b> " + TransactionRecord::formatSubTxId(wtx.GetHash(), rec->idx) + "<br>";
strHTML += "<b>" + tr("Transaction ID") + ":</b> " + rec->getTxID() + "<br>";
strHTML += "<b>" + tr("Output index") + ":</b> " + QString::number(rec->getOutputIndex()) + "<br>";
// Message from normal bitcoin:URI (bitcoin:123...?message=example)
Q_FOREACH (const PAIRTYPE(std::string, std::string)& r, wtx.vOrderForm)

7
src/qt/transactionrecord.cpp

@ -260,11 +260,10 @@ bool TransactionRecord::statusUpdateNeeded() @@ -260,11 +260,10 @@ bool TransactionRecord::statusUpdateNeeded()
QString TransactionRecord::getTxID() const
{
return formatSubTxId(hash, idx);
return QString::fromStdString(hash.ToString());
}
QString TransactionRecord::formatSubTxId(const uint256 &hash, int vout)
int TransactionRecord::getOutputIndex() const
{
return QString::fromStdString(hash.ToString() + strprintf("-%03d", vout));
return idx;
}

4
src/qt/transactionrecord.h

@ -128,8 +128,8 @@ public: @@ -128,8 +128,8 @@ public:
/** Return the unique identifier for this transaction (part) */
QString getTxID() const;
/** Format subtransaction id */
static QString formatSubTxId(const uint256 &hash, int vout);
/** Return the output index of the subtransaction */
int getOutputIndex() const;
/** Update status from core wallet tx.
*/

Loading…
Cancel
Save