X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=Novacoin%2FCBlockStore.cs;h=133a18e94acf3c39e099b10b1afa5a750113a530;hb=377462d9b5ba1d99ff474f351d1e06e37799e4f9;hp=604df454d97c34db6896adf01a2df738115264f3;hpb=9b0ad0055f7ed6f2761a58a189d35b62d51a0ee4;p=NovacoinLibrary.git 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)) {