mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 21:31:37 +00:00
core/rawdb: rename WriteTxLookupEntries to WriteTxLookupEntriesByBlock (#21480)
This commit is contained in:
parent
d7e0e9d734
commit
2d5dc550d0
2 changed files with 3 additions and 3 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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{
|
||||
|
|
|
|||
Loading…
Reference in a new issue