X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=Novacoin%2FScriptCode.cs;h=14bc2e5d45668edb72449cd0d0d3f2573ec642ed;hb=0fe762d6eee8a8a23033f813217c1675a34f2d6a;hp=f1e6efde7f0236e44ad69742852b4a6982c66f59;hpb=28fd34406126d49bbadf29b0a5d0343d6cf7ed6f;p=NovacoinLibrary.git diff --git a/Novacoin/ScriptCode.cs b/Novacoin/ScriptCode.cs index f1e6efd..14bc2e5 100644 --- a/Novacoin/ScriptCode.cs +++ b/Novacoin/ScriptCode.cs @@ -247,7 +247,7 @@ namespace Novacoin /// Found instruction. /// IEnumerable out param which is used to get the push arguments. /// Result of operation - public static bool GetOp(ref ByteQueue codeBytes, out instruction opcodeRet, out byte[] bytesRet) + public static bool GetOp(ref InstructionQueue codeBytes, out instruction opcodeRet, out byte[] bytesRet) { bytesRet = new byte[0]; instruction opcode = opcodeRet = instruction.OP_INVALIDOPCODE; @@ -292,7 +292,7 @@ namespace Novacoin nSize = BitConverter.ToInt32(codeBytes.Get(4), 0); } } - catch (ByteQueueException) + catch (InstructionQueueException) { // Unable to read operand length return false; @@ -541,8 +541,8 @@ namespace Novacoin instruction opcode1, opcode2; // Compare - var bq1 = script1.GetByteQueue(); - var bq2 = script2.GetByteQueue(); + var bq1 = script1.GetInstructionQueue(); + var bq2 = script2.GetInstructionQueue(); byte[] args1, args2; @@ -844,7 +844,7 @@ namespace Novacoin var falseBytes = new byte[0]; var trueBytes = new byte[] { 0x01 }; - var CodeQueue = script.GetByteQueue(); + var CodeQueue = script.GetInstructionQueue(); var altStack = new List(); #if !DEBUG @@ -1492,25 +1492,25 @@ namespace Novacoin { return false; } - Hash hash = null; + byte[] hash = null; var data = stacktop(ref stack, -1); switch (opcode) { case instruction.OP_HASH160: - hash = Hash160.Compute160(data); + hash = CryptoUtils.ComputeHash160(data); break; case instruction.OP_HASH256: - hash = Hash256.Compute256(data); + hash = CryptoUtils.ComputeHash256(data); break; case instruction.OP_SHA1: - hash = SHA1.Compute1(data); + hash = CryptoUtils.ComputeSha1(data); break; case instruction.OP_SHA256: - hash = SHA256.Compute256(data); + hash = CryptoUtils.ComputeSha256(data); break; case instruction.OP_RIPEMD160: - hash = RIPEMD160.Compute160(data); + hash = CryptoUtils.ComputeRipeMD160(data); break; } popstack(ref stack);