Skip to content
This repository has been archived by the owner on Jun 9, 2024. It is now read-only.

Commit

Permalink
remove unused cache
Browse files Browse the repository at this point in the history
  • Loading branch information
itsdevbear committed Nov 1, 2023
1 parent 5f9a6af commit 13594da
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions eth/core/chain_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,21 @@ func (bc *blockchain) WriteBlockAndSetHead(
// to finalize the block.
bc.finalizedBlock.Store(block)

// Write the receipts cache.
// TODO deprecate this cache?
if receipts != nil {
bc.receiptsCache.Add(block.Hash(), receipts)
// Store txLookup entries for all transactions in the block.
blockNum := block.NumberU64()
blockHash := block.Hash()
bc.blockNumCache.Add(blockNum, block)
bc.blockHashCache.Add(blockHash, block)
for txIndex, tx := range block.Transactions() {
bc.txLookupCache.Add(
tx.Hash(),
&types.TxLookupEntry{
Tx: tx,
TxIndex: uint64(txIndex),
BlockNum: blockNum,
BlockHash: blockHash,
},
)
}

// Fire off the feeds.
Expand Down

0 comments on commit 13594da

Please sign in to comment.