Don't create coins for empty coinbase transactions
authoralex <alex@alex-VirtualBox.(none)>
Mon, 20 Jan 2014 00:07:28 +0000 (04:07 +0400)
committeralex <alex@alex-VirtualBox.(none)>
Mon, 20 Jan 2014 00:07:28 +0000 (04:07 +0400)
src/main.cpp

index 81ff299..0543508 100644 (file)
@@ -1552,6 +1552,10 @@ bool CBlock::DisconnectBlock(CBlockIndex *pindex, CCoinsView &view)
         const CTransaction &tx = vtx[i];
         uint256 hash = tx.GetHash();
 
+        // don't check coinbase coins for proof-of-stake block
+        if(IsProofOfStake() && tx.IsCoinBase())
+            continue;
+
         // check that all outputs are available
         CCoins outs;
         if (!view.GetCoins(hash, outs))
@@ -1683,6 +1687,10 @@ bool CBlock::ConnectBlock(CBlockIndex* pindex, CCoinsView &view, bool fJustCheck
             nValueOut += tx.GetValueOut();
         }
 
+        // don't create coinbase coins for proof-of-stake block
+        if(IsProofOfStake() && tx.IsCoinBase())
+            continue;
+
         CTxUndo txundo;
         if (!tx.UpdateCoins(view, txundo, pindex->nHeight, pindex->nTime))
             return error("ConnectBlock() : UpdateInputs failed");