mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-16 17:03:46 +00:00
ethdb: use RLock for Has
This commit is contained in:
parent
1e6dcb35ab
commit
c9b7a2a4b7
1 changed files with 2 additions and 2 deletions
|
|
@ -46,8 +46,8 @@ func (db *MemDatabase) Put(key []byte, value []byte) error {
|
|||
}
|
||||
|
||||
func (db *MemDatabase) Has(key []byte) (bool, error) {
|
||||
db.lock.Lock()
|
||||
defer db.lock.Unlock()
|
||||
db.lock.RLock()
|
||||
defer db.lock.RUnlock()
|
||||
|
||||
_, ok := db.db[string(key)]
|
||||
return ok, nil
|
||||
|
|
|
|||
Loading…
Reference in a new issue