Unverified 提交 c7dc3c33 作者: Steven Allen 提交者: GitHub

Merge pull request #6419 from ipfs/fix/6418

pin: fix concurrent map access race
......@@ -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 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论