Use CScript for vin and vout,
[NovacoinLibrary.git] / Novacoin / CBlock.cs
index 68e813a..17ffe6a 100644 (file)
@@ -28,7 +28,7 @@ namespace Novacoin
         /// Parse byte sequence and initialize new block instance
         /// </summary>
         /// <param name="blockBytes"></param>
-               public CBlock (List<byte> blockBytes)
+               public CBlock (IList<byte> blockBytes)
                {
             header = new CBlockHeader();
 
@@ -53,22 +53,25 @@ namespace Novacoin
         /// Convert current instance into sequence of bytes
         /// </summary>
         /// <returns>Byte sequence</returns>
-        public IList<byte> ToBytes()
+        public IList<byte> Bytes 
         {
-            List<byte> r = new List<byte>();
+            get
+            {
+                List<byte> r = new List<byte>();
 
-            r.AddRange(header.ToBytes());
-            r.AddRange(VarInt.EncodeVarInt(vtx.LongLength)); // transactions count
+                r.AddRange(header.Bytes);
+                r.AddRange(VarInt.EncodeVarInt(vtx.LongLength)); // transactions count
 
-            foreach (CTransaction tx in vtx)
-            {
-                r.AddRange(tx.ToBytes());
-            }
+                foreach (CTransaction tx in vtx)
+                {
+                    r.AddRange(tx.Bytes);
+                }
 
-            r.AddRange(VarInt.EncodeVarInt(signature.LongLength));
-            r.AddRange(signature);
+                r.AddRange(VarInt.EncodeVarInt(signature.LongLength));
+                r.AddRange(signature);
 
-            return r;
+                return r;
+            }
         }
 
         public override string ToString()