// SetHead updates the head hash and total difficulty of the peer.
765621
func (p *peer) SetHead(hash common.Hash, td *big.Int) {
	p.lock.Lock()
	defer p.lock.Unlock()

	copy(p.head[:], hash[:])
	p.td.Set(td)
}
258573
func (s *SamplingRuleUpdate) SetHTTPMethod(v string) *SamplingRuleUpdate {
	s.HTTPMethod = &v
	return s
}
673155
func (s *GetIntegrationInput) SetHttpMethod(v string) *GetIntegrationInput {
	s.HttpMethod = &v
	return s
}
799612
func (r *Request) SetHeader(key, value string) *Request {
	r.header.Add(key, value)
	return r
}
597868
func (dht *IpfsDHT) Update(ctx context.Context, p peer.ID) {
	logger.Event(ctx, "updatePeer", p)
	dht.routingTable.Update(p)
}
813037
func (s *PutMethodResponseInput) SetHttpMethod(v string) *PutMethodResponseInput {
	s.HttpMethod = &v
	return s
}
94541
func (c *Client) SetHeader(key, value string) *Client {
	c.Use(headers.Set(key, value))
	return c
}
1008142
func (s *DescribeHandshakeInput) SetHandshakeId(v string) *DescribeHandshakeInput {
	s.HandshakeId = &v
	return s
}
37507
func (f *lightFetcher) peerHasBlock(p *peer, hash common.Hash, number uint64, hasState bool) bool {
	f.lock.Lock()
	defer f.lock.Unlock()

	fp := f.peers[p]
	if fp == nil || fp.root == nil {
		return false
	}

	if hasState {
		if fp.lastAnnounced == nil || fp.lastAnnounced.number > number+serverStateAvailable {
			return false
		}
	}

	if f.syncing {
		// always return true when syncing
		// false positives are acceptable, a more sophisticated condition can be implemented later
		return true
	}

	if number >= fp.root.number {
		// it is recent enough that if it is known, is should be in the peer's block tree
		return fp.nodeByHash[hash] != nil
	}
	f.chain.LockChain()
	defer f.chain.UnlockChain()
	// if it's older than the peer's block tree root but it's in the same canonical chain
	// as the root, we can still be sure the peer knows it
	//
	// when syncing, just check if it is part of the known chain, there is nothing better we
	// can do since we do not know the most recent block hash yet
	return rawdb.ReadCanonicalHash(f.pm.chainDb, fp.root.number) == fp.root.hash && rawdb.ReadCanonicalHash(f.pm.chainDb, number) == hash
}
378630
func (s *Method) SetHttpMethod(v string) *Method {
	s.HttpMethod = &v
	return s
}
244637
func (p *peerConnection) SetHeadersIdle(delivered int) {
	p.setIdle(p.headerStarted, delivered, &p.headerThroughput, &p.headerIdle)
}
173224
func (c *Client) SetHeaders(headers http.Header) {
	c.modifyLock.Lock()
	defer c.modifyLock.Unlock()

	c.headers = headers
}
754576
func (s *CreateChannelOutput) SetHlsIngest(v *HlsIngest) *CreateChannelOutput {
	s.HlsIngest = v
	return s
}
708461
func (s *AcceptHandshakeOutput) SetHandshake(v *Handshake) *AcceptHandshakeOutput {
	s.Handshake = v
	return s
}
688019
func (s *AttachmentContent) SetHash(v string) *AttachmentContent {
	s.Hash = &v
	return s
}
1346855
func (gr *GoReq) SetHeader(param string, value string) *GoReq {
	gr.Header[param] = value
	return gr
}
770250
func (r *Response) SetHeader(key, value string) *Response {
	r.Header.Set(key, value)
	return r
}