From 2d5dc550d0c4daa648446c9de1b2dc797624116d Mon Sep 17 00:00:00 2001 From: Daniel Liu Date: Tue, 24 Dec 2024 17:36:11 +0800 Subject: [PATCH] core/rawdb: rename WriteTxLookupEntries to WriteTxLookupEntriesByBlock (#21480) --- core/blockchain.go | 2 +- core/rawdb/accessors_indexes.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/blockchain.go b/core/blockchain.go index 480fa60601..d38b3eec6a 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -735,7 +735,7 @@ func (bc *BlockChain) writeHeadBlock(block *types.Block, writeBlock bool) { // Add the block to the canonical chain number scheme and mark as the head batch := bc.db.NewBatch() rawdb.WriteCanonicalHash(batch, blockHash, blockNumberU64) - rawdb.WriteTxLookupEntries(batch, block) + rawdb.WriteTxLookupEntriesByBlock(batch, block) rawdb.WriteHeadBlockHash(batch, blockHash) if writeBlock { rawdb.WriteBlock(batch, block) diff --git a/core/rawdb/accessors_indexes.go b/core/rawdb/accessors_indexes.go index edb2633257..7f94098751 100644 --- a/core/rawdb/accessors_indexes.go +++ b/core/rawdb/accessors_indexes.go @@ -30,9 +30,9 @@ type TxLookupEntry struct { Index uint64 } -// WriteTxLookupEntries stores a positional metadata for every transaction from +// WriteTxLookupEntriesByBlock stores a positional metadata for every transaction from // a block, enabling hash based transaction and receipt lookups. -func WriteTxLookupEntries(db ethdb.KeyValueWriter, block *types.Block) { +func WriteTxLookupEntriesByBlock(db ethdb.KeyValueWriter, block *types.Block) { // Iterate over each transaction and encode its metadata for i, tx := range block.Transactions() { entry := TxLookupEntry{