Add previous block checking in the proof-of-stake miner
[novacoin.git] / src / miner.cpp
index 7c494fa..d5ace13 100644 (file)
@@ -306,13 +306,16 @@ CBlock* CreateNewBlock(CWallet* pwallet, bool fProofOfStake)
             if (nBlockSigOps + nTxSigOps >= MAX_BLOCK_SIGOPS)
                 continue;
 
+/*
+ * We need to call UpdateCoins using actual block timestamp, so don't perform this here.
+ *
             CTxUndo txundo;
             if (!tx.UpdateCoins(viewTemp, txundo, pindexPrev->nHeight+1, pblock->nTime))
                 continue;
 
             // push changes from the second layer cache to the first one
             viewTemp.Flush();
-
+*/
             // Added
             pblock->vtx.push_back(tx);
             nBlockSize += nTxSize;
@@ -378,7 +381,7 @@ void IncrementExtraNonce(CBlock* pblock, CBlockIndex* pindexPrev, unsigned int&
     }
     ++nExtraNonce;
 
-    unsigned int nHeight = pindexPrev->nHeight+1; // Height first in coinbase required for block.version=2
+    unsigned int nHeight = pindexPrev->nHeight+1; // Height first in coinbase required
     pblock->vtx[0].vin[0].scriptSig = (CScript() << nHeight << CBigNum(nExtraNonce)) + COINBASE_FLAGS;
     assert(pblock->vtx[0].vin[0].scriptSig.size() <= 100);
 
@@ -561,7 +564,5 @@ void StakeMiner(CWallet *pwallet)
         }
         else
             Sleep(nMinerSleep);
-
-        continue;
     }
 }