mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 04:36:42 +00:00
core/blockchain: remove useless locking of txLookup
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
This commit is contained in:
parent
69341bc95a
commit
90344dc27b
1 changed files with 0 additions and 3 deletions
|
|
@ -329,12 +329,9 @@ func (bc *BlockChain) GetAncestor(hash common.Hash, number, ancestor uint64, max
|
||||||
// access altogether.
|
// access altogether.
|
||||||
func (bc *BlockChain) HasCanonicalTransaction(hash common.Hash, cacheOnly bool) bool {
|
func (bc *BlockChain) HasCanonicalTransaction(hash common.Hash, cacheOnly bool) bool {
|
||||||
// Check in memory cache first
|
// Check in memory cache first
|
||||||
bc.txLookupLock.RLock()
|
|
||||||
if _, exist := bc.txLookupCache.Get(hash); exist {
|
if _, exist := bc.txLookupCache.Get(hash); exist {
|
||||||
bc.txLookupLock.RUnlock()
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
bc.txLookupLock.RUnlock()
|
|
||||||
|
|
||||||
// Fallback to database lookup, without reading the transaction itself
|
// Fallback to database lookup, without reading the transaction itself
|
||||||
if !cacheOnly && rawdb.HasCanonicalTransaction(bc.db, hash) {
|
if !cacheOnly && rawdb.HasCanonicalTransaction(bc.db, hash) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue