code: func (a *AddrManager) GetBestLocalAddress(remoteAddr *wire.NetAddress) *wire.NetAddress {
  	a.lamtx.Lock()
  	defer a.lamtx.Unlock()
  
  	bestreach := 0
  	var bestscore AddressPriority
  	var bestAddress *wire.NetAddress
  	for _, la := range a.localAddresses {
  		reach := getReachabilityFrom(la.na, remoteAddr)
  		if reach > bestreach ||
  			(reach == bestreach && la.score > bestscore) {
  			bestreach = reach
  			bestscore = la.score
  			bestAddress = la.na
  		}
  	}
  	if bestAddress != nil {
  		log.Debugf("Suggesting address %s:%d for %s:%d", bestAddress.IP,
  			bestAddress.Port, remoteAddr.IP, remoteAddr.Port)
  	} else {
  		log.Debugf("No worthy address for %s:%d", remoteAddr.IP,
  			remoteAddr.Port)
  
  		// Send something unroutable if nothing suitable.
  		var ip net.IP
  		if !IsIPv4(remoteAddr) && !IsOnionCatTor(remoteAddr) {
  			ip = net.IPv6zero
  		} else {
  			ip = net.IPv4zero
  		}
  		services := wire.SFNodeNetwork | wire.SFNodeWitness | wire.SFNodeBloom
  		bestAddress = wire.NewNetAddressIPPort(ip, 0, services)
  	}
  
  	return bestAddress
  }
docs: // GetBestLocalAddress returns the most appropriate local address to use
  // for the given remote address.