Yet another cosmetic change.
authorCryptoManiac <balthazar.ad@gmail.com>
Tue, 1 Sep 2015 07:20:41 +0000 (10:20 +0300)
committerCryptoManiac <balthazar.ad@gmail.com>
Tue, 1 Sep 2015 07:20:41 +0000 (10:20 +0300)
Novacoin/CBlock.cs
Novacoin/CBlockStore.cs
Novacoin/CTransaction.cs

index d8d7a75..8ac3cad 100644 (file)
@@ -47,6 +47,11 @@ namespace Novacoin
     /// </summary>
     public class CBlock
        {
+        /// <summary>
+        /// Maximum block size is 1Mb.
+        /// </summary>
+        public const uint nMaxBlockSize = 1000000;
+
                /// <summary>
                /// Block header.
                /// </summary>
@@ -122,7 +127,7 @@ namespace Novacoin
             uint nSigOps = 0; // total sigops
 
             // Basic sanity checkings
-            if (vtx.Length == 0 || Size > 1000000)
+            if (vtx.Length == 0 || Size > nMaxBlockSize)
             {
                 return false;
             }
index 11190a9..fb60e2b 100644 (file)
@@ -273,7 +273,7 @@ namespace Novacoin
         /// <returns>Result</returns>
         public bool ReadFromFile(ref Stream reader, out CTransaction tx)
         {
-            var buffer = new byte[250000]; // Max transaction size is 250kB
+            var buffer = new byte[CTransaction.nMaxTxSize];
             tx = null;
 
             try
@@ -661,7 +661,7 @@ namespace Novacoin
 
             var nOffset = 0L;
 
-            var buffer = new byte[1000000]; // Max block size is 1Mb
+            var buffer = new byte[CBlock.nMaxBlockSize]; // Max block size is 1Mb
             var intBuffer = new byte[4];
 
             var fStream2 = File.OpenRead(BlockFile);
index fd62f41..1070703 100644 (file)
@@ -56,6 +56,11 @@ namespace Novacoin
         public const ulong nMaxMoney = 2000000000 * nCoin;
 
         /// <summary>
+        /// Maximum transaction size is 250Kb
+        /// </summary>
+        public const uint nMaxTxSize = 250000;
+
+        /// <summary>
         /// Version of transaction schema.
         /// </summary>
         public uint nVersion;
@@ -174,7 +179,7 @@ namespace Novacoin
         /// <returns>Checking result</returns>
         public bool CheckTransaction()
         {
-            if (Size > 250000 || vin.Length == 0 || vout.Length == 0)
+            if (Size > nMaxTxSize || vin.Length == 0 || vout.Length == 0)
             {
                 return false;
             }