// RefCount returns two integers (total, staged).
// total is the total number of ref counts for the Cid.
// staged is the total number of ref counts corresponding to
// staged pins. total includes staged, this means that:
// * total >= staged
// * non-staged pins = total - staged.
RefCount returns two integers (total, staged).
total is the total number of ref counts for the Cid.
staged is the total number of ref counts corresponding to
staged pins.
// RefCount returns two integers ( total staged ) . // total is the total number of ref counts for the Cid . // staged is the total number of ref counts corresponding to // staged pins . total includes staged this means that : // * total > = staged // * non - staged pins = total - staged .
func (s *Store) RefCount(c cid.Cid) (int, int) {
	s.lock.Lock()
	defer s.lock.Unlock()
	r, ok := s.cache[c]
	if !ok {
		return 0, 0
	}
	var stagedPins int
	for _, p := range r.Pins {
		if p.Staged {
			stagedPins++
		}
	}
	return len(r.Pins), stagedPins
}
func ( s * Store ) RefCount ( c cid . Cid ) ( int , int ) { s . lock . Lock ( ) defer s . lock . Unlock ( ) r , ok := s . cache [ c ] if ! ok { return 0 , 0 } var stagedPins int for _ , p := range r . Pins { if p . Staged { stagedPins ++ } } return len ( r . Pins ) , stagedPins }
RefCount returns two integers (total, staged).
RefCount returns two integers ( total staged ) .