mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-23 13:16:42 +00:00
Update proof.go
This commit is contained in:
parent
488d987fc4
commit
f5fd50a1be
1 changed files with 5 additions and 3 deletions
|
|
@ -85,9 +85,11 @@ func (db *ProofSet) Get(key []byte) ([]byte, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Has returns true if the node set contains the given key
|
// Has returns true if the node set contains the given key
|
||||||
func (db *ProofSet) Has(key []byte) (bool, error) {
|
db.lock.RLock()
|
||||||
_, err := db.Get(key)
|
defer db.lock.RUnlock()
|
||||||
return err == nil, nil
|
|
||||||
|
_, ok := db.nodes[string(key)]
|
||||||
|
return ok, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// KeyCount returns the number of nodes in the set
|
// KeyCount returns the number of nodes in the set
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue