Update accessors_indexes.go

This commit is contained in:
Ömer Faruk Irmak 2025-06-13 18:09:39 +03:00 committed by GitHub
parent de7fe6a24a
commit 7623170f6a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -158,11 +158,14 @@ func ReadTransaction(db ethdb.Reader, hash common.Hash) (*types.Transaction, com
for txnIterator.Next() && txnIterator.Err() == nil {
txnRLP := txnIterator.Value()
// Figure out if this a legacy transaction or not
// Preimage for hash calculation of legacy transactions
// are just their RLP encoding, but for EIP-2728 transactions
// the prefix needs to be trimmed before hashing.
rlpKind, hashPreimage, _, err := rlp.Split(txnRLP)
if err != nil {
return nil, common.Hash{}, 0, 0
}
// Legacy transactions are encoded as rlp lists.
if rlpKind == rlp.List {
hashPreimage = txnRLP
}