From 18da34e295da6ad0b3dcd833ce1bc3a2cb15a39c Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Wed, 30 Mar 2016 15:44:40 +0200 Subject: [PATCH] Merge #7761: [Qt] remove trailing output-index from transaction-id 7d5e31a [Qt] remove trailing output-index from transaction-id (Jonas Schnelli) --- src/qt/transactiondesc.cpp | 3 ++- src/qt/transactionrecord.cpp | 7 +++---- src/qt/transactionrecord.h | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/qt/transactiondesc.cpp b/src/qt/transactiondesc.cpp index 42077baff9..edbc3c7d0f 100644 --- a/src/qt/transactiondesc.cpp +++ b/src/qt/transactiondesc.cpp @@ -264,7 +264,8 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, TransactionReco if (wtx.mapValue.count("comment") && !wtx.mapValue["comment"].empty()) strHTML += "
" + tr("Comment") + ":
" + GUIUtil::HtmlEscape(wtx.mapValue["comment"], true) + "
"; - strHTML += "" + tr("Transaction ID") + ": " + TransactionRecord::formatSubTxId(wtx.GetHash(), rec->idx) + "
"; + strHTML += "" + tr("Transaction ID") + ": " + rec->getTxID() + "
"; + strHTML += "" + tr("Output index") + ": " + QString::number(rec->getOutputIndex()) + "
"; strHTML += "" + tr("Transaction total size") + ": " + QString::number(wtx.GetTotalSize()) + " bytes
"; // Message from normal dash:URI (dash:XyZ...?message=example) diff --git a/src/qt/transactionrecord.cpp b/src/qt/transactionrecord.cpp index 1116703440..54711d82e2 100644 --- a/src/qt/transactionrecord.cpp +++ b/src/qt/transactionrecord.cpp @@ -324,11 +324,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; } - diff --git a/src/qt/transactionrecord.h b/src/qt/transactionrecord.h index c238ef5769..37b1a0c6ca 100644 --- a/src/qt/transactionrecord.h +++ b/src/qt/transactionrecord.h @@ -138,8 +138,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. */