Browse Source

Show short scriptPubKeys correctly

Previously bitcoin-qt's -debug transaction info was showing CTxOut([error])

It is valid for a scriptPubKey to be any size, for example simply
OP_RETURN is valid and can be used to destroy a TXOUT to mining fees.
0.10
Peter Todd 11 years ago
parent
commit
005609539b
No known key found for this signature in database
GPG Key ID: 2481403DA5F091FB
  1. 2
      src/core.cpp

2
src/core.cpp

@ -63,8 +63,6 @@ uint256 CTxOut::GetHash() const
std::string CTxOut::ToString() const std::string CTxOut::ToString() const
{ {
if (scriptPubKey.size() < 6)
return "CTxOut(error)";
return strprintf("CTxOut(nValue=%"PRI64d".%08"PRI64d", scriptPubKey=%s)", nValue / COIN, nValue % COIN, scriptPubKey.ToString().substr(0,30).c_str()); return strprintf("CTxOut(nValue=%"PRI64d".%08"PRI64d", scriptPubKey=%s)", nValue / COIN, nValue % COIN, scriptPubKey.ToString().substr(0,30).c_str());
} }

Loading…
Cancel
Save