// Immediate operand
if (opcode <= instruction.OP_PUSHDATA4)
{
- byte[] szBytes = new byte[4] { 0, 0, 0, 0 }; // Zero length
+ var szBytes = new byte[4] { 0, 0, 0, 0 }; // Zero length
try
{
// In case concatenating two scripts ends up with two codeseparators,
// or an extra one at the end, this prevents all those possible incompatibilities.
- script.RemovePattern(new byte[] { (byte)instruction.OP_CODESEPARATOR });
+ //script.RemovePattern(new byte[] { (byte)instruction.OP_CODESEPARATOR }); // TODO: issue here, due to false matches this breaks the validation of some scripts
// Blank out other inputs' signatures
for (int i = 0; i < txTmp.vin.Length; i++)
return false;
}
- byte[] sigBytes = stacktop(ref stack, -2);
- byte[] pubkeyBytes = stacktop(ref stack, -1);
+ var sigBytes = stacktop(ref stack, -2);
+ var pubkeyBytes = stacktop(ref stack, -1);
// Subset of script starting at the most recent codeseparator
- CScript scriptCode = new CScript(script.Bytes.Skip(nCodeHashBegin));
+ var scriptCode = new CScript(script.Bytes.Skip(nCodeHashBegin).ToArray());
// There's no way for a signature to sign itself
scriptCode.RemovePattern(sigBytes);
}
// Subset of script starting at the most recent codeseparator
- CScript scriptCode = new CScript(script.Bytes.Skip(nCodeHashBegin));
+ var scriptCode = new CScript(script.Bytes.Skip(nCodeHashBegin).ToArray());
// There is no way for a signature to sign itself, so we need to drop the signatures
for (int k = 0; k < nSigsCount; k++)