Skip to content

Commit

Permalink
Merge pull request #6419 from ipfs/fix/6418
Browse files Browse the repository at this point in the history
pin: fix concurrent map access race
  • Loading branch information
Stebalien committed Jun 6, 2019
2 parents 505eeed + 486f013 commit c7dc3c3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pin/pin.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}

Expand Down

0 comments on commit c7dc3c3

Please sign in to comment.