Limit duplicity on stake & Process orphans only if there are some.
[NovacoinLibrary.git] / Novacoin / CBlock.cs
index 8064b9d..b616fa5 100644 (file)
@@ -164,7 +164,7 @@ namespace Novacoin
                     return false;
                 }
 
-                // Coinbase output should be empty if proof-of-stake block
+                // Coinbase output must be empty if proof-of-stake block
                 if (vtx[0].vout.Length != 1 || !vtx[0].vout[0].IsEmpty)
                 {
                     return false;
@@ -179,7 +179,7 @@ namespace Novacoin
                 // Check proof-of-stake block signature
                 if (fCheckSig && !SignatureOK)
                 {
-                    return false;
+                    return false; // Proof-of-Stake signature checking failure.
                 }
 
                 if (!vtx[1].CheckTransaction())
@@ -269,7 +269,7 @@ namespace Novacoin
             return true;
         }
 
-        private bool CheckProofOfWork(uint256 hash, uint nBits)
+        private static bool CheckProofOfWork(uint256 hash, uint nBits)
         {
             uint256 nTarget = new uint256();
             nTarget.Compact = nBits;
@@ -594,6 +594,12 @@ namespace Novacoin
 
             return nSubsidy;
         }
-    }
+
+        public Tuple<COutPoint, uint> ProofOfStake
+        {
+            get { return IsProofOfStake ? new Tuple<COutPoint, uint>(vtx[1].vin[0].prevout, vtx[1].nTime) : new Tuple<COutPoint, uint>(new COutPoint(), 0); }
+        }
+
+}
 }