nMaxSigOps constant.
[NovacoinLibrary.git] / Novacoin / CBlock.cs
index d8d7a75..3f72c68 100644 (file)
@@ -47,6 +47,16 @@ namespace Novacoin
     /// </summary>
     public class CBlock
        {
+        /// <summary>
+        /// Maximum block size is 1Mb.
+        /// </summary>
+        public const uint nMaxBlockSize = 1000000;
+
+        /// <summary>
+        /// Sanity threshold for amount of sigops.
+        /// </summary>
+        public const uint nMaxSigOps = 20000;
+
                /// <summary>
                /// Block header.
                /// </summary>
@@ -122,7 +132,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;
             }
@@ -245,7 +255,7 @@ namespace Novacoin
             }
 
             // Reject block if validation would consume too much resources.
-            if (nSigOps > 50000)
+            if (nSigOps > nMaxSigOps)
             {
                 return false;
             }