Generic class was a bit excessive for our purposes
[NovacoinLibrary.git] / Novacoin / CTxIn.cs
index 671a0a1..8cff600 100644 (file)
@@ -22,7 +22,7 @@ namespace Novacoin
                /// <summary>
                /// Transaction variant number, irrelevant if nLockTime isn't specified. Its value is 0xffffffff by default.
                /// </summary>
-        public uint nSequence = 0xffffffff;
+        public uint nSequence = uint.MaxValue;
 
         /// <summary>
         /// Initialize new CTxIn instance as copy of another one.
@@ -49,7 +49,7 @@ namespace Novacoin
         /// </summary>
         /// <param name="wBytes">Reference to byte sequence</param>
         /// <returns>Inputs array</returns>
-        public static CTxIn[] ReadTxInList(ref WrappedList<byte> wBytes)
+        public static CTxIn[] ReadTxInList(ref ByteQueue wBytes)
         {
             CTxIn[] vin;
 
@@ -61,9 +61,9 @@ namespace Novacoin
             {
                 // Fill inputs array
                 vin[nIndex] = new CTxIn();
-                vin[nIndex].prevout = new COutPoint(wBytes.GetItems(36));
-                vin[nIndex].scriptSig = new CScript(wBytes.GetItems((int)VarInt.ReadVarInt(ref wBytes)));
-                vin[nIndex].nSequence = BitConverter.ToUInt32(wBytes.GetItems(4), 0);
+                vin[nIndex].prevout = new COutPoint(wBytes.Get(36));
+                vin[nIndex].scriptSig = new CScript(wBytes.Get((int)VarInt.ReadVarInt(ref wBytes)));
+                vin[nIndex].nSequence = BitConverter.ToUInt32(wBytes.Get(4), 0);
             }
 
             // Return inputs array
@@ -100,18 +100,6 @@ namespace Novacoin
                {
                        StringBuilder sb = new StringBuilder ();
 
-            /*
-            if (IsCoinBase)
-            {
-                sb.AppendFormat("CTxIn(txId={0}, coinbase={2}, nSequence={3})", txID.ToString(), n, Interop.ToHex(scriptSig.Bytes), nSequence);
-            }
-            else
-            {
-                sb.AppendFormat("CTxIn(txId={0}, n={1}, scriptSig={2}, nSequence={3})", txID.ToString(), n, scriptSig.ToString(), nSequence);
-            }
-            */
-
-
             sb.AppendFormat("CTxIn(");
             sb.Append(prevout.ToString());