mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 12:46:44 +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
|
||||
func (db *ProofSet) Has(key []byte) (bool, error) {
|
||||
_, err := db.Get(key)
|
||||
return err == nil, nil
|
||||
db.lock.RLock()
|
||||
defer db.lock.RUnlock()
|
||||
|
||||
_, ok := db.nodes[string(key)]
|
||||
return ok, nil
|
||||
}
|
||||
|
||||
// KeyCount returns the number of nodes in the set
|
||||
|
|
|
|||
Loading…
Reference in a new issue