diff --git a/core/blockchain_reader.go b/core/blockchain_reader.go index 0b9689b8bd..831f59facc 100644 --- a/core/blockchain_reader.go +++ b/core/blockchain_reader.go @@ -329,12 +329,9 @@ func (bc *BlockChain) GetAncestor(hash common.Hash, number, ancestor uint64, max // access altogether. func (bc *BlockChain) HasCanonicalTransaction(hash common.Hash, cacheOnly bool) bool { // Check in memory cache first - bc.txLookupLock.RLock() if _, exist := bc.txLookupCache.Get(hash); exist { - bc.txLookupLock.RUnlock() return true } - bc.txLookupLock.RUnlock() // Fallback to database lookup, without reading the transaction itself if !cacheOnly && rawdb.HasCanonicalTransaction(bc.db, hash) {