Skip to content

Commit

Permalink
core/rawdb: remove unused deriveLogFields (#29913)
Browse files Browse the repository at this point in the history
Co-authored-by: Gary Rong <[email protected]>
Co-authored-by: Martin HS <[email protected]>
  • Loading branch information
3 people authored and ucwong committed Jun 5, 2024
1 parent d04fe6b commit f62cb53
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions core/rawdb/accessors_chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ package rawdb
import (
"bytes"
"encoding/binary"
"errors"
"fmt"
"math/big"

Expand Down Expand Up @@ -717,27 +716,6 @@ func (r *receiptLogs) DecodeRLP(s *rlp.Stream) error {
return nil
}

// DeriveLogFields fills the logs in receiptLogs with information such as block number, txhash, etc.
func deriveLogFields(receipts []*receiptLogs, hash common.Hash, number uint64, txs types.Transactions) error {
logIndex := uint(0)
if len(txs) != len(receipts) {
return errors.New("transaction and receipt count mismatch")
}
for i := 0; i < len(receipts); i++ {
txHash := txs[i].Hash()
// The derived log fields can simply be set from the block and transaction
for j := 0; j < len(receipts[i].Logs); j++ {
receipts[i].Logs[j].BlockNumber = number
receipts[i].Logs[j].BlockHash = hash
receipts[i].Logs[j].TxHash = txHash
receipts[i].Logs[j].TxIndex = uint(i)
receipts[i].Logs[j].Index = logIndex
logIndex++
}
}
return nil
}

// ReadLogs retrieves the logs for all transactions in a block. In case
// receipts is not found, a nil is returned.
// Note: ReadLogs does not derive unstored log fields.
Expand Down

0 comments on commit f62cb53

Please sign in to comment.