Small stack pushes are not treated as int when converting scripts to asm - treat all as hex.

This commit is contained in:
Miroslav Kovar 2018-07-13 13:27:29 +02:00
parent b9a1b60555
commit 3d0b033614

View file

@ -87,9 +87,6 @@ string ScriptToAsmStr(const CScript& script, const bool fAttemptSighashDecode)
return str; return str;
} }
if (0 <= opcode && opcode <= OP_PUSHDATA4) { if (0 <= opcode && opcode <= OP_PUSHDATA4) {
if (vch.size() <= static_cast<vector<unsigned char>::size_type>(4)) {
str += strprintf("%d", CScriptNum(vch, false).getint());
} else {
// the IsUnspendable check makes sure not to try to decode OP_RETURN data that may match the format of a signature // the IsUnspendable check makes sure not to try to decode OP_RETURN data that may match the format of a signature
if (fAttemptSighashDecode && !script.IsUnspendable()) { if (fAttemptSighashDecode && !script.IsUnspendable()) {
string strSigHashDecode; string strSigHashDecode;
@ -108,7 +105,6 @@ string ScriptToAsmStr(const CScript& script, const bool fAttemptSighashDecode)
} else { } else {
str += HexStr(vch); str += HexStr(vch);
} }
}
} else { } else {
str += GetOpName(opcode); str += GetOpName(opcode);
} }