From 377462d9b5ba1d99ff474f351d1e06e37799e4f9 Mon Sep 17 00:00:00 2001 From: CryptoManiac Date: Tue, 8 Sep 2015 01:33:16 +0300 Subject: [PATCH] Issue to be dealt with in the near future. --- Novacoin/CBlockStore.cs | 13 +++++++++---- 1 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Novacoin/CBlockStore.cs b/Novacoin/CBlockStore.cs index 604df45..133a18e 100644 --- a/Novacoin/CBlockStore.cs +++ b/Novacoin/CBlockStore.cs @@ -260,7 +260,7 @@ namespace Novacoin var inputsKey = new COutPoint(item.TransactionHash, item.nOut); - item.IsSpent = true; +// item.IsSpent = true; // Add output data to dictionary inputs.Add(inputsKey, (TxOutItem)item); @@ -703,8 +703,11 @@ namespace Novacoin for (var i = 0u; i < tx.vout.Length; i++) { - var mNode = new CMerkleNode(cursor.ItemID, nTxPos, tx); - queuedMerkleNodes.Add(hashTx, mNode); + if (!queuedMerkleNodes.ContainsKey(hashTx)) + { + var mNode = new CMerkleNode(cursor.ItemID, nTxPos, tx); + queuedMerkleNodes.Add(hashTx, mNode); + } var outKey = new COutPoint(hashTx, i); var outData = new TxOutItem(); @@ -713,7 +716,6 @@ namespace Novacoin outData.scriptPubKey = tx.vout[i].scriptPubKey; outData.nOut = i; - outData.IsSpent = false; queued.Add(outKey, outData); @@ -758,6 +760,9 @@ namespace Novacoin } else { + // TODO: Bug here, we shouldn't mix new and already existent outpoints in the same dictionary. + + merkleNode = queuedMerkleNodes[txID]; if (!SaveMerkleNode(ref merkleNode)) { -- 1.7.1