core/rawdb: simplify HasCanonicalTransaction

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
This commit is contained in:
Csaba Kiraly 2025-11-30 00:28:05 +01:00
parent 8197ceef16
commit 69341bc95a
No known key found for this signature in database
GPG key ID: 0FE274EE8C95166E

View file

@ -176,8 +176,7 @@ func findTxInBlockBody(blockbody rlp.RawValue, target common.Hash) (*types.Trans
// HasCanonicalTransaction checks whether a specific transaction is in the database. // HasCanonicalTransaction checks whether a specific transaction is in the database.
func HasCanonicalTransaction(db ethdb.Reader, hash common.Hash) bool { func HasCanonicalTransaction(db ethdb.Reader, hash common.Hash) bool {
blockNumber := ReadTxLookupEntry(db, hash) return ReadTxLookupEntry(db, hash) != nil
return blockNumber != nil
} }
// ReadCanonicalTransaction retrieves a specific transaction from the database, along // ReadCanonicalTransaction retrieves a specific transaction from the database, along