Update proof.go

This commit is contained in:
conomist 2025-11-13 17:07:09 +01:00 committed by GitHub
parent 488d987fc4
commit f5fd50a1be
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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