From: CryptoManiac Date: Mon, 7 Sep 2015 22:33:16 +0000 (+0300) Subject: Issue to be dealt with in the near future. X-Git-Url: https://git.novaco.in/?p=NovacoinLibrary.git;a=commitdiff_plain;h=377462d9b5ba1d99ff474f351d1e06e37799e4f9 Issue to be dealt with in the near future. --- 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)) {