}
/// <summary>
- /// Adds specified operation to opcode bytes list
+ /// Adds specified operation to instruction list
/// </summary>
/// <param name="opcode"></param>
- 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);
}
/// <summary>
- /// Adds hash to opcode bytes list.
+ /// Adds hash to instruction list.
/// New items are added in this format:
/// hash_length_byte hash_bytes
/// </summary>
}
/// <summary>
- /// Adds hash to opcode bytes list.
+ /// Adds hash to instruction list.
/// New items are added in this format:
/// hash_length_byte hash_bytes
/// </summary>
}
/// <summary>
- /// Create new OP_PUSHDATAn operator and add it to opcode bytes list
+ /// Create new OP_PUSHDATAn operator and add it to instruction list
/// </summary>
/// <param name="dataBytes">Set of data bytes</param>
public void PushData(byte[] dataBytes)
{
codeBytes.Clear();
PushData(pubKey.PublicBytes);
- AddOp(instruction.OP_CHECKSIG);
+ AddInstruction(instruction.OP_CHECKSIG);
}
/// <summary>
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);
}
/// <summary>
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);
}
/// <summary>
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);
}
/// <summary>