Skip to content

Commit

Permalink
Show OP_RETURN message in transaction details
Browse files Browse the repository at this point in the history
  • Loading branch information
Graham Higgins committed Apr 16, 2017
1 parent cf1549d commit 05ee8c0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions src/qt/transactiondesc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

#include <QString>

#include "smalldata.h"

using namespace std;

QString TransactionDesc::FormatTxStatus(const CWalletTx& wtx)
Expand Down Expand Up @@ -225,6 +227,11 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx)

strHTML += QString("<b>") + tr("Transaction ID:") + "</b> " + wtx.GetHash().ToString().c_str() + "<br>";

std::string txmsg;
bool isBroadcast;
if ( GetTxMessage(wtx, txmsg, isBroadcast) )
strHTML += "<b>" + tr("Message") + ":</b> " + txmsg.c_str() + "<br>";

if(wtx.IsCoinBase())
strHTML += QString("<br>") + tr("Generated coins must wait 520 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, it will change to \"not accepted\" and not be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.") + "<br>";
if(wtx.IsCoinStake())
Expand Down
4 changes: 2 additions & 2 deletions src/smalldata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ bool GetTxMessage(CTransaction &tx, std::string &msg, bool &isBroadcast)
{
txnouttype whichType;
BOOST_FOREACH(const CTxOut& txout, tx.vout) {
if ( 0 != txout.nValue )
continue;
// if ( 0 != txout.nValue )
// continue;

vector<valtype> vSolutions;
txnouttype whichType;
Expand Down

0 comments on commit 05ee8c0

Please sign in to comment.