mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-19 19:30:44 +00:00
core/rawdb: fix iterator error handling in findTxInBlockBody
This commit is contained in:
parent
30656d714e
commit
e44cf33890
1 changed files with 3 additions and 3 deletions
|
|
@ -147,9 +147,6 @@ func findTxInBlockBody(blockbody rlp.RawValue, target common.Hash) (*types.Trans
|
|||
}
|
||||
txIndex := uint64(0)
|
||||
for iter.Next() {
|
||||
if iter.Err() != nil {
|
||||
return nil, 0, iter.Err()
|
||||
}
|
||||
// The preimage for the hash calculation of legacy transactions
|
||||
// is just their RLP encoding. For typed (EIP-2718) transactions,
|
||||
// which are encoded as byte arrays, the preimage is the content of
|
||||
|
|
@ -171,6 +168,9 @@ func findTxInBlockBody(blockbody rlp.RawValue, target common.Hash) (*types.Trans
|
|||
}
|
||||
txIndex++
|
||||
}
|
||||
if iter.Err() != nil {
|
||||
return nil, 0, iter.Err()
|
||||
}
|
||||
return nil, 0, errors.New("transaction not found")
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue