ethdb: use RLock for Has

This commit is contained in:
Felix Lange 2017-09-08 19:26:46 +02:00
parent 1e6dcb35ab
commit c9b7a2a4b7

View file

@ -46,8 +46,8 @@ func (db *MemDatabase) Put(key []byte, value []byte) error {
} }
func (db *MemDatabase) Has(key []byte) (bool, error) { func (db *MemDatabase) Has(key []byte) (bool, error) {
db.lock.Lock() db.lock.RLock()
defer db.lock.Unlock() defer db.lock.RUnlock()
_, ok := db.db[string(key)] _, ok := db.db[string(key)]
return ok, nil return ok, nil