mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-25 06:06:44 +00:00
Update accessors_indexes.go
This commit is contained in:
parent
de7fe6a24a
commit
7623170f6a
1 changed files with 4 additions and 1 deletions
|
|
@ -158,11 +158,14 @@ func ReadTransaction(db ethdb.Reader, hash common.Hash) (*types.Transaction, com
|
||||||
for txnIterator.Next() && txnIterator.Err() == nil {
|
for txnIterator.Next() && txnIterator.Err() == nil {
|
||||||
txnRLP := txnIterator.Value()
|
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)
|
rlpKind, hashPreimage, _, err := rlp.Split(txnRLP)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, common.Hash{}, 0, 0
|
return nil, common.Hash{}, 0, 0
|
||||||
}
|
}
|
||||||
|
// Legacy transactions are encoded as rlp lists.
|
||||||
if rlpKind == rlp.List {
|
if rlpKind == rlp.List {
|
||||||
hashPreimage = txnRLP
|
hashPreimage = txnRLP
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue