From 55cc6763b3de83eb2d3015c9fa4fd41637dc681a Mon Sep 17 00:00:00 2001 From: Lazy Nina Date: Sun, 22 Dec 2024 19:48:59 -0500 Subject: [PATCH] add comment about why 'optimization' actually doesn't work --- lib/pos_blockchain.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/pos_blockchain.go b/lib/pos_blockchain.go index dce96cbb8..e209a5c80 100644 --- a/lib/pos_blockchain.go +++ b/lib/pos_blockchain.go @@ -1962,6 +1962,9 @@ func (bc *Blockchain) GetUtxoViewAndUtxoOpsAtBlockHash(blockHash BlockHash, bloc var utxoOps [][]*UtxoOperation var fullBlock *MsgDeSoBlock for ii := len(uncommittedAncestors) - 1; ii >= 0; ii-- { + // TODO: this optimization is disabled for now. Although this speeds up the fetching of + // a utxo view for a given block hash, it actually ends up building up a lot of data in the + // view of already committed data. // Check the cache to see if we already have a view for this block. //cachedView, cachedAncestorExists := bc.getCachedBlockViewAndUtxoOps(*uncommittedAncestors[ii].Hash) //if cachedAncestorExists {