code: func (p *BlockPuller) connectToSomeEndpoint(minRequestedSequence uint64) {
  	// Probe all endpoints in parallel, searching an endpoint with a given minimum block sequence
  	// and then sort them by their endpoints to a map.
  	endpointsInfo := p.probeEndpoints(minRequestedSequence).byEndpoints()
  	if len(endpointsInfo) == 0 {
  		p.Logger.Warningf("Could not connect to any endpoint of %v", p.Endpoints)
  		return
  	}
  
  	// Choose a random endpoint out of the available endpoints
  	chosenEndpoint := randomEndpoint(endpointsInfo)
  	// Disconnect all connections but this endpoint
  	for endpoint, endpointInfo := range endpointsInfo {
  		if endpoint == chosenEndpoint {
  			continue
  		}
  		endpointInfo.conn.Close()
  	}
  
  	p.conn = endpointsInfo[chosenEndpoint].conn
  	p.endpoint = chosenEndpoint
  	p.latestSeq = endpointsInfo[chosenEndpoint].lastBlockSeq
  
  	p.Logger.Infof("Connected to %s with last block seq of %d", p.endpoint, p.latestSeq)
  }
docs: // connectToSomeEndpoint makes the BlockPuller connect to some endpoint that has
  // the given minimum block sequence.