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{