core/rawdb: increase readability
This commit is contained in:
parent
46230b1e4f
commit
9dbb4830c1
|
@ -143,7 +143,10 @@ func ReadReceipt(db ethdb.Reader, txHash common.Hash, config *params.ChainConfig
|
|||
|
||||
// Find a match tx and derive receipt fields
|
||||
for txIndex, tx := range blockBody.Transactions {
|
||||
if tx.Hash() == txHash {
|
||||
if tx.Hash() != txHash {
|
||||
continue
|
||||
}
|
||||
|
||||
// Read raw receipts only if hash matches
|
||||
receipts := ReadRawReceipts(db, blockHash, *blockNumber)
|
||||
if receipts == nil {
|
||||
|
@ -182,7 +185,6 @@ func ReadReceipt(db ethdb.Reader, txHash common.Hash, config *params.ChainConfig
|
|||
}
|
||||
return targetReceipt, blockHash, *blockNumber, uint64(txIndex)
|
||||
}
|
||||
}
|
||||
|
||||
log.Error("Receipt not found", "number", *blockNumber, "blockHash", blockHash, "txHash", txHash)
|
||||
return nil, common.Hash{}, 0, 0
|
||||
|
|
Loading…
Reference in New Issue