Use implicit type casting operator for serialization.
[NovacoinLibrary.git] / Novacoin / CNovacoinAddress.cs
index 22e94ae..bf5321a 100644 (file)
@@ -58,7 +58,7 @@ namespace Novacoin
         public CNovacoinAddress(CKeyID keyID)
         {
             nVersion = (byte)AddrType.PUBKEY_ADDRESS;
-            addrData = new List<byte>(keyID.hashBytes);
+            addrData = new List<byte>((byte[])keyID);
         }
 
         public CNovacoinAddress(string strNovacoinAddress)
@@ -76,7 +76,15 @@ namespace Novacoin
         public CNovacoinAddress(CScriptID scriptID)
         {
             nVersion = (byte)AddrType.SCRIPT_ADDRESS;
-            addrData = new List<byte>(scriptID.hashBytes);
+            addrData = new List<byte>((byte[])scriptID);
+        }
+
+        /// <summary>
+        /// 20 bytes, Hash160 of script or public key
+        /// </summary>
+        public byte[] HashBytes
+        {
+            get { return addrData.ToArray(); }
         }
 
         /// <summary>