mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 04:36:42 +00:00
core/rawdb: simplify HasCanonicalTransaction
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
This commit is contained in:
parent
8197ceef16
commit
69341bc95a
1 changed files with 1 additions and 2 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue