Limit duplicity on stake & Process orphans only if there are some.
[NovacoinLibrary.git] / Novacoin / CBlock.cs
index 450612a..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())
@@ -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); }
+        }
+
+}
 }