Commit 4eaa9166 authored by Steven Allen's avatar Steven Allen

pin: fix concurrent map access race

Not sure why this didn't show up sooner.

fixes #6418
parent 4e5b0e8d
......@@ -498,11 +498,17 @@ func LoadPinner(d ds.Datastore, dserv, internal ipld.DAGService) (Pinner, error)
// DirectKeys returns a slice containing the directly pinned keys
func (p *pinner) DirectKeys() []cid.Cid {
p.lock.RLock()
defer p.lock.RUnlock()
return p.directPin.Keys()
}
// RecursiveKeys returns a slice containing the recursively pinned keys
func (p *pinner) RecursiveKeys() []cid.Cid {
p.lock.RLock()
defer p.lock.RUnlock()
return p.recursePin.Keys()
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment