From 68a95f86c133f19e44723238b769aa0495370d07 Mon Sep 17 00:00:00 2001 From: CryptoManiac Date: Mon, 24 Aug 2015 01:07:43 +0300 Subject: [PATCH] Comments --- Novacoin/CBlock.cs | 2 +- Novacoin/CScript.cs | 32 ++++++++++++++++---------------- Novacoin/ScriptCode.cs | 26 +++++++++++++------------- 3 files changed, 30 insertions(+), 30 deletions(-) diff --git a/Novacoin/CBlock.cs b/Novacoin/CBlock.cs index 7511fdf..f33dda6 100644 --- a/Novacoin/CBlock.cs +++ b/Novacoin/CBlock.cs @@ -168,7 +168,7 @@ namespace Novacoin } /// - /// MErkle root + /// Merkle root /// public Hash256 hashMerkleRoot { diff --git a/Novacoin/CScript.cs b/Novacoin/CScript.cs index 9149d34..405a4b3 100644 --- a/Novacoin/CScript.cs +++ b/Novacoin/CScript.cs @@ -74,21 +74,21 @@ namespace Novacoin } /// - /// Adds specified operation to opcode bytes list + /// Adds specified operation to instruction list /// /// - public void AddOp(instruction opcode) + public void AddInstruction(instruction opcode) { if (opcode < instruction.OP_0 || opcode > instruction.OP_INVALIDOPCODE) { - throw new CScriptException("CScript::AddOp() : invalid opcode"); + throw new CScriptException("CScript::AddInstruction() : invalid instruction"); } codeBytes.Add((byte)opcode); } /// - /// Adds hash to opcode bytes list. + /// Adds hash to instruction list. /// New items are added in this format: /// hash_length_byte hash_bytes /// @@ -100,7 +100,7 @@ namespace Novacoin } /// - /// Adds hash to opcode bytes list. + /// Adds hash to instruction list. /// New items are added in this format: /// hash_length_byte hash_bytes /// @@ -112,7 +112,7 @@ namespace Novacoin } /// - /// Create new OP_PUSHDATAn operator and add it to opcode bytes list + /// Create new OP_PUSHDATAn operator and add it to instruction list /// /// Set of data bytes public void PushData(byte[] dataBytes) @@ -385,7 +385,7 @@ namespace Novacoin { codeBytes.Clear(); PushData(pubKey.PublicBytes); - AddOp(instruction.OP_CHECKSIG); + AddInstruction(instruction.OP_CHECKSIG); } /// @@ -395,11 +395,11 @@ namespace Novacoin public void SetDestination(CKeyID ID) { codeBytes.Clear(); - AddOp(instruction.OP_DUP); - AddOp(instruction.OP_HASH160); + AddInstruction(instruction.OP_DUP); + AddInstruction(instruction.OP_HASH160); AddHash(ID); - AddOp(instruction.OP_EQUALVERIFY); - AddOp(instruction.OP_CHECKSIG); + AddInstruction(instruction.OP_EQUALVERIFY); + AddInstruction(instruction.OP_CHECKSIG); } /// @@ -409,9 +409,9 @@ namespace Novacoin public void SetDestination(CScriptID ID) { codeBytes.Clear(); - AddOp(instruction.OP_HASH160); + AddInstruction(instruction.OP_HASH160); AddHash(ID); - AddOp(instruction.OP_EQUAL); + AddInstruction(instruction.OP_EQUAL); } /// @@ -430,15 +430,15 @@ namespace Novacoin public void SetMultiSig(int nRequired, CPubKey[] keys) { codeBytes.Clear(); - AddOp(ScriptCode.EncodeOP_N(nRequired)); + AddInstruction(ScriptCode.EncodeOP_N(nRequired)); foreach (var key in keys) { PushData(key.PublicBytes); } - AddOp(ScriptCode.EncodeOP_N(keys.Length)); - AddOp(instruction.OP_CHECKMULTISIG); + AddInstruction(ScriptCode.EncodeOP_N(keys.Length)); + AddInstruction(instruction.OP_CHECKMULTISIG); } /// diff --git a/Novacoin/ScriptCode.cs b/Novacoin/ScriptCode.cs index c90bf87..eaafed1 100644 --- a/Novacoin/ScriptCode.cs +++ b/Novacoin/ScriptCode.cs @@ -23,7 +23,7 @@ using System.Text; namespace Novacoin { /// - /// Script opcodes + /// Script instructions /// public enum instruction { @@ -223,10 +223,10 @@ namespace Novacoin } /// - /// Get the name of supplied opcode + /// Get the name of instruction /// - /// Opcode - /// Opcode name + /// Instruction + /// Instruction name public static string GetOpName(instruction opcode) { if (opcode == instruction.OP_0) // OP_0 and OP_FALSE are synonyms @@ -238,10 +238,10 @@ namespace Novacoin } /// - /// Get next opcode from passed list of bytes and extract push arguments if there are some. + /// Get next instruction from list of bytes and extract push arguments if there are some. /// /// ByteQueue reference. - /// Found opcode. + /// 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) @@ -271,7 +271,7 @@ namespace Novacoin { if (opcode < instruction.OP_PUSHDATA1) { - // Zero value opcodes (OP_0, OP_FALSE) + // Zero value instructions (OP_0, OP_FALSE) szBytes[3] = (byte)opcode; } else if (opcode == instruction.OP_PUSHDATA1) @@ -364,7 +364,7 @@ namespace Novacoin /// /// Decode instruction to integer value /// - /// Small integer opcode (OP_1_NEGATE and OP_0 - OP_16) + /// Small integer instruction (OP_1_NEGATE and OP_0 - OP_16) /// Small integer public static int DecodeOP_N(instruction opcode, bool AllowNegate = false) { @@ -378,7 +378,7 @@ namespace Novacoin return 0; } - // Only OP_n opcodes are supported, throw exception otherwise. + // Only OP_n instructions are supported, throw exception otherwise. if (opcode < instruction.OP_1 || opcode > instruction.OP_16) { throw new ArgumentException("Invalid integer instruction."); @@ -391,7 +391,7 @@ namespace Novacoin /// Converts integer into instruction /// /// Small integer from the range of -1 up to 16. - /// Corresponding opcode. + /// Corresponding instruction. public static instruction EncodeOP_N(int n, bool allowNegate = false) { if (allowNegate && n == -1) @@ -520,7 +520,7 @@ namespace Novacoin // Sender provides N pubkeys, receivers provides M signatures // N [pubkey1] [pubkey2] ... [pubkeyN] M OP_CHECKMULTISIG - // Where N and M are small integer opcodes (OP1 ... OP_16) + // Where N and M are small integer instructions (OP1 ... OP_16) templateTuples.Add( new Tuple( txnouttype.TX_MULTISIG, @@ -591,7 +591,7 @@ namespace Novacoin break; } - // Template matching opcodes: + // Template matching instructions: if (opcode2 == instruction.OP_PUBKEYS) { while (args1.Count() >= 33 && args1.Count() <= 120) @@ -908,7 +908,7 @@ namespace Novacoin switch (opcode) { // - // Disabled opcodes + // Disabled instructions // case instruction.OP_CAT: case instruction.OP_SUBSTR: -- 1.7.1