diff --git a/src/main.h b/src/main.h index 34ec560c..b673a4bb 100644 --- a/src/main.h +++ b/src/main.h @@ -387,7 +387,7 @@ class CTxOut std::string ToStringShort() const { - return strprintf(" out amount %s", FormatMoney(nValue).c_str()); + return strprintf(" out %s %s", FormatMoney(nValue).c_str(), scriptPubKey.ToString(true).c_str()); } std::string ToString() const @@ -395,7 +395,7 @@ class CTxOut if (IsEmpty()) return "CTxOut(empty)"; if (scriptPubKey.size() < 6) return "CTxOut(error)"; - return strprintf("CTxOut(nValue=%s, scriptPubKey=%s)", FormatMoney(nValue).c_str(), scriptPubKey.ToString().substr(0,30).c_str()); + return strprintf("CTxOut(nValue=%s, scriptPubKey=%s)", FormatMoney(nValue).c_str(), scriptPubKey.ToString().c_str()); } void print() const diff --git a/src/script.h b/src/script.h index 2aa08feb..9a19b638 100644 --- a/src/script.h +++ b/src/script.h @@ -532,7 +532,7 @@ class CScript : public std::vector printf("CScript(%s)\n", HexStr(begin(), end(), true).c_str()); } - std::string ToString() const + std::string ToString(bool fShort=false) const { std::string str; opcodetype opcode; @@ -548,7 +548,7 @@ class CScript : public std::vector return str; } if (0 <= opcode && opcode <= OP_PUSHDATA4) - str += ValueString(vch); + str += fShort? ValueString(vch).substr(0, 10) : ValueString(vch); else str += GetOpName(opcode); }