func ConnectToDestinationAuto(client *lndwrapper.Lnd, db *DB, address [4]byte, routeToken string) {

	var err error

	if !db.IsAddressRegistered(address) {
		log.Println("Trying to connect to unregistered address", address)
		return
	}
	destinationPubKey := db.GetAddressNode(address)
	neighborIPs := GetNodeIPs(client, destinationPubKey)

	for _, ipAddress := range neighborIPs {
		log.Println("Trying to connect to", PubKeyArrayToString(destinationPubKey), "@", ipAddress+":"+DefaultPort)
		err = ConnectToDestination(client, db, address, ipAddress+":"+DefaultPort, routeToken)
		if err != nil {
			log.Println(err)
		} else {
			break
		}
	}
}
//ConnectToDestinationAuto connects to a destination node using its IP
ConnectToDestinationAuto connects to a destination node using its IP
// ConnectToDestinationAuto connects to a destination node using its IP
func ConnectToDestinationAuto(client *lndwrapper.Lnd, db *DB, address [4]byte, routeToken string) {
	var err error
	if !db.IsAddressRegistered(address) {
		log.Println("Trying to connect to unregistered address", address)
		return
	}
	destinationPubKey := db.GetAddressNode(address)
	neighborIPs := GetNodeIPs(client, destinationPubKey)
	for _, ipAddress := range neighborIPs {
		log.Println("Trying to connect to", PubKeyArrayToString(destinationPubKey), "@", ipAddress+":"+DefaultPort)
		err = ConnectToDestination(client, db, address, ipAddress+":"+DefaultPort, routeToken)
		if err != nil {
			log.Println(err)
		} else {
			break
		}
	}
}
func ConnectToDestinationAuto ( client * lndwrapper . Lnd , db * DB , address [ 4 ] byte , routeToken string ) { var err error if ! db . IsAddressRegistered ( address ) { log . Println ( " " , address ) return } destinationPubKey := db . GetAddressNode ( address ) neighborIPs := GetNodeIPs ( client , destinationPubKey ) for _ , ipAddress := range neighborIPs { log . Println ( " " , PubKeyArrayToString ( destinationPubKey ) , " " , ipAddress + " " + DefaultPort ) err = ConnectToDestination ( client , db , address , ipAddress + " " + DefaultPort , routeToken ) if err != nil { log . Println ( err ) } else { break } } }
ConnectToDestinationAuto connects to a destination node using its IP
ConnectToDestinationAuto connects to a destination node using its IP