// HasActiveLink returns true if the given channel ID has a link in the link
// index AND the link is eligible to forward.
185405
func (s *Switch) HasActiveLink(chanID lnwire.ChannelID) bool {
	s.indexMtx.RLock()
	defer s.indexMtx.RUnlock()

	if link, ok := s.linkIndex[chanID]; ok {
		return link.EligibleToForward()
	}

	return false
}
202564
func (f *failureDomainsQuorum) isDomainActive(ipDomain string) bool {
	isActive, _ := f.activeMap[ipDomain]
	if isActive == types.CLUSTER_DOMAIN_STATE_ACTIVE {
		return true
	}
	return false
}
1275096
func IsLink(path string) bool {
	s, err := os.Stat(path)
	if err != nil {
		return false
	}
	return (s.Mode()&os.ModeSymlink == os.ModeSymlink)
}
1269357
func (s *TagOptionDetail) SetActive(v bool) *TagOptionDetail {
	s.Active = &v
	return s
}
1258691
func (s *Switch) removeLink(chanID lnwire.ChannelID) ChannelLink {
	log.Infof("Removing channel link with ChannelID(%v)", chanID)

	link, err := s.getLink(chanID)
	if err != nil {
		return nil
	}

	// Inform the Channel Notifier about the link becoming inactive.
	s.cfg.NotifyInactiveChannel(*link.ChannelPoint())

	// Remove the channel from live link indexes.
	delete(s.pendingLinkIndex, link.ChanID())
	delete(s.linkIndex, link.ChanID())
	delete(s.forwardingIndex, link.ShortChanID())

	// If the link has been added to the peer index, then we'll move to
	// delete the entry within the index.
	peerPub := link.Peer().PubKey()
	if peerIndex, ok := s.interfaceIndex[peerPub]; ok {
		delete(peerIndex, link.ChanID())

		// If after deletion, there are no longer any links, then we'll
		// remove the interface map all together.
		if len(peerIndex) == 0 {
			delete(s.interfaceIndex, peerPub)
		}
	}

	return link
}
1023405
func (s *Switch) getLink(chanID lnwire.ChannelID) (ChannelLink, error) {
	link, ok := s.linkIndex[chanID]
	if !ok {
		link, ok = s.pendingLinkIndex[chanID]
		if !ok {
			return nil, ErrChannelLinkNotFound
		}
	}

	return link, nil
}
35516
func (ss *subStore) hasActiveSubs() bool {
	ss.RLock()
	defer ss.RUnlock()
	if len(ss.psubs) > 0 {
		return true
	}
	for _, qsub := range ss.qsubs {
		// For a durable queue group, when the group is offline,
		// qsub.shadow is not nil, but the qsub.subs array should be
		// empty.
		if len(qsub.subs) > 0 {
			return true
		}
	}
	return false
}
1185175
func WithActive(active bool) userSearchF {
	return func(s userSearch) userSearch {
		s = append(s, userSearchParam{name: "includeActive", value: fmt.Sprintf("%t", active)})
		return s
	}
}
216051
func (cgs *credentialGraphSet) Active() ([]registry.CredentialGraph, error) {
	active := make([]registry.CredentialGraph, 0, len(cgs.graphs))

	for _, graphs := range cgs.graphs {

		// parents is the slice of IDs already seen in Previous fields.
		// they cannot be active as they have been overwritten.
		var parents []identity.ID

		sort.Sort(graphSorter(graphs))
		for headOffset, graph := range graphs {
			var activeCreds []envelope.CredentialInf
			var err error
			activeCreds, parents, err = cgs.activeCreds(parents, graph)
			if err != nil {
				return nil, err
			}

			// the most recent version of a keyring is always active
			// (it could be filled entirely with unset values)
			if len(activeCreds) > 0 || headOffset == 0 {
				active = append(active, graph)
			}
		}
	}

	return active, nil
}
221184
func (t TeamSigChainState) IsLinkFilled(seqno keybase1.Seqno) bool {
	if seqno > t.inner.LastSeqno {
		return false
	}
	if seqno < 0 {
		return false
	}
	return !t.inner.StubbedLinks[seqno]
}
80506
func (m *ChannelMap) HasPosition(p ChannelPosition) bool {
	return C.pa_channel_map_has_position(m.toC(), C.pa_channel_position_t(p)) != 0
}
1285879
func (r *marathonClient) HasSubscription(callback string) (bool, error) {
	// step: generate our events callback
	subscriptions, err := r.Subscriptions()
	if err != nil {
		return false, err
	}

	for _, subscription := range subscriptions.CallbackURLs {
		if callback == subscription {
			return true, nil
		}
	}

	return false, nil
}
858145
func (b BuilderID) SelfLink(project string) string {
	return model.BuilderIDLink(string(b), project)
}
911922
func (q *LinkedBlockingDeque) linkFirst(e interface{}) bool {
	if q.count >= q.capacity {
		return false
	}
	f := q.first
	x := newNode(e, nil, f)
	q.first = x
	if q.last == nil {
		q.last = x
	} else {
		f.prev = x
	}
	q.count = q.count + 1
	q.notEmpty.Signal()
	return true
}
1052036
func (a *Advertisement) Connectable() bool {
	return a.EventType() == evtTypAdvDirectInd || a.EventType() == evtTypAdvInd
}
734226
func WithRelatedActivityID(activityID *guid.GUID) EventOpt {
	return func(options *eventOptions) {
		options.relatedActivityID = activityID
	}
}
67869
func (p *PriorityQueue) movePodsToActiveQueue(podInfoList []*podInfo) {
	for _, pInfo := range podInfoList {
		pod := pInfo.pod
		if p.isPodBackingOff(pod) {
			if err := p.podBackoffQ.Add(pInfo); err != nil {
				klog.Errorf("Error adding pod %v to the backoff queue: %v", pod.Name, err)
			}
		} else {
			if err := p.activeQ.Add(pInfo); err != nil {
				klog.Errorf("Error adding pod %v to the scheduling queue: %v", pod.Name, err)
			}
		}
		p.unschedulableQ.delete(pod)
	}
	p.moveRequestCycle = p.schedulingCycle
	p.cond.Broadcast()
}