Save best height, best hash and best trust.
[NovacoinLibrary.git] / Novacoin / CScript.cs
index cd6d27a..d27b337 100644 (file)
@@ -73,7 +73,7 @@ namespace Novacoin
         ///    New items are added in this format:
         ///    hash_length_byte hash_bytes
         /// </summary>
-        /// <param name="hash">Hash160 instance</param>
+        /// <param name="hash">uint160 instance</param>
         public void AddHash(uint160 hash)
         {
             codeBytes.Add((byte)hash.Size);
@@ -85,7 +85,7 @@ namespace Novacoin
         ///    New items are added in this format:
         ///    hash_length_byte hash_bytes
         /// </summary>
-        /// <param name="hash">Hash256 instance</param>
+        /// <param name="hash">uint256 instance</param>
         public void AddHash(uint256 hash)
         {
             codeBytes.Add((byte)hash.Size);
@@ -501,6 +501,15 @@ namespace Novacoin
         }
 
         /// <summary>
+        /// Implicit cast of byte array to CScript.
+        /// </summary>
+        /// <param name="scriptBytes"></param>
+        public static implicit operator CScript(byte[] scriptBytes)
+        {
+            return new CScript(scriptBytes);
+        }
+
+        /// <summary>
         /// Script size
         /// </summary>
         public int Size
@@ -510,7 +519,7 @@ namespace Novacoin
 
         public CScriptID ScriptID
         {
-            get { return new CScriptID(Hash160.Compute160(codeBytes.ToArray())); }
+            get { return new CScriptID(CryptoUtils.ComputeHash160(codeBytes.ToArray())); }
         }
 
         /// <summary>