// MarkAttempt implements AddrBook - it marks that an attempt was made to connect to the address.
493656
func (a *addrBook) MarkAttempt(addr *p2p.NetAddress) {
	a.mtx.Lock()
	defer a.mtx.Unlock()

	ka := a.addrLookup[addr.ID]
	if ka == nil {
		return
	}
	ka.markAttempt()
}
403062
func (n *node) markBeingDeleted() {
	n.beingDeletedLock.Lock()
	defer n.beingDeletedLock.Unlock()
	n.beingDeleted = true
}
1162079
func (client *Client) SetTagsContext(t map[string]string) {
	client.mu.Lock()
	defer client.mu.Unlock()
	client.context.setTags(t)
}
454589
func (sc *Client) MarkTrustedPeer(ctx context.Context, enode string) error {
	var ignored bool
	return sc.c.CallContext(ctx, &ignored, "shh_markTrustedPeer", enode)
}
219523
func (s *HTTPScaffold) handleMarkdown(resp http.ResponseWriter, req *http.Request) {
	if req.Method != s.markdownMethod {
		resp.WriteHeader(http.StatusMethodNotAllowed)
		return
	}

	req.Body.Close()
	s.tracker.markDown()
	if s.markdownHandler != nil {
		s.markdownHandler()
	}
}
503066
func (pc *peerContainer) handleAttempt(event *peerEvent) []*peerEvent {
	bundle, events := pc.bundle(event.IP)
	bundle.Attempts = append(bundle.Attempts, &peerAttempt{
		Connected:    *event.Connected,
		Disconnected: *event.Disconnected,
	})
	pc.attemptOrder = append(pc.attemptOrder, event.IP)
	for len(pc.attemptOrder) > attemptLimit {
		// While the length of the connection attempt order array is greater
		// than the limit, remove the first element from the involved peer's
		// array and also from the super array.
		events = append(events, pc.removeAttempt(pc.attemptOrder[0])...)
		pc.attemptOrder = pc.attemptOrder[1:]
	}
	return events
}
1051244
func (m *CountMeter) Mark(i int64) {
	m.mtx.Lock()
	defer m.mtx.Unlock()
	m.counters[0] += i
	m.overall += i
}
408074
func AddElementToMap(
	sets map[string][]interface{},
	elem interface{},
	key string,
) {
	if s, ok := sets[key]; ok {
		sets[key] = append(s, elem)
	} else {
		sets[key] = make([]interface{}, 0)
		sets[key] = append(sets[key], elem)
	}
}
739449
func (b *ByteBuf) MarkIndex(index int) error {
	if index > b.Capacity() || index <= b.readerIndex {
		return io.ErrShortBuffer
	}

	b.markedIndex = index
	return nil
}
659702
func LongAttempt() RetryStrategy {
	return RetryStrategy{
		Count:          100,
		Break:          10 * time.Millisecond,
		BreakIncrement: 25 * time.Millisecond,
		Timeout:        5 * time.Minute,
	}
}
1165961
func markAddressUsed(ns walletdb.ReadWriteBucket, scope *KeyScope,
	addressID []byte) error {

	scopedBucket, err := fetchWriteScopeBucket(ns, scope)
	if err != nil {
		return err
	}

	bucket := scopedBucket.NestedReadWriteBucket(usedAddrBucketName)

	addrHash := sha256.Sum256(addressID)
	val := bucket.Get(addrHash[:])
	if val != nil {
		return nil
	}

	err = bucket.Put(addrHash[:], []byte{0})
	if err != nil {
		str := fmt.Sprintf("failed to mark address used %x", addressID)
		return managerError(ErrDatabase, str, err)
	}

	return nil
}
564729
func MakeAttempt(c context.Context, aid *dm.Attempt_ID) *Attempt {
	now := clock.Now(c).UTC()
	return &Attempt{
		ID:       *aid,
		Created:  now,
		Modified: now,
	}
}
560361
func (m *Message) AddAttachment(a *Attachment) {
	m.Attachments = append(m.Attachments, a)
}
957639
func (r *Route) addRegexpMatcher(regex string) error {
	if r.err != nil {
		return r.err
	}

	r.AddMatcher(&RegexpMatcher{regex: regex})
	return nil
}
1144319
func (ml *MockRouteCountLogger) TraceD(title string, data map[string]interface{}) {
	ml.logger.TraceD(title, data)
}
634292
func NewConnectResults(results ...ConnectResult) ConnectAttemptResults {
	mapResults := make(map[Attempt]ConnectResult)
	for _, r := range results {
		mapResults[r.Attempt] = r
	}
	return mapResults
}
996265
func (t *compactionTracker) SnapshotAttempted(success bool, reason CacheStatus, duration time.Duration) {
	t.Attempted(0, success, reason.String(), duration)
}