func ConnectToDestination(client *lndwrapper.Lnd, db *DB, address [4]byte, ipAddress string, routeToken string) error {
	conn, err := net.Dial("tcp", ipAddress)
	if err != nil {
		return err
	}
	writeConnectionType(conn, destinationConn)
	log.Println("Connected to:" + conn.RemoteAddr().String())

	//Send code for route request
	routeTokenBytes := []byte(routeToken)
	_, err = conn.Write(routeTokenBytes)
	if err != nil {
		return err
	}
	db.addDestConnToDB(routeToken, &connInfo{conn: conn})

	return nil
}
//ConnectToDestination connects to a destination node using the provided IP
ConnectToDestination connects to a destination node using the provided IP
// ConnectToDestination connects to a destination node using the provided IP
func ConnectToDestination(client *lndwrapper.Lnd, db *DB, address [4]byte, ipAddress string, routeToken string) error {
	conn, err := net.Dial("tcp", ipAddress)
	if err != nil {
		return err
	}
	writeConnectionType(conn, destinationConn)
	log.Println("Connected to:" + conn.RemoteAddr().String())
	routeTokenBytes := []byte(routeToken)
	_, err = conn.Write(routeTokenBytes)
	if err != nil {
		return err
	}
	db.addDestConnToDB(routeToken, &connInfo{conn: conn})
	return nil
}
func ConnectToDestination ( client * lndwrapper . Lnd , db * DB , address [ 4 ] byte , ipAddress string , routeToken string ) error { conn , err := net . Dial ( " " , ipAddress ) if err != nil { return err } writeConnectionType ( conn , destinationConn ) log . Println ( " " + conn . RemoteAddr ( ) . String ( ) ) routeTokenBytes := [ ] byte ( routeToken ) _ , err = conn . Write ( routeTokenBytes ) if err != nil { return err } db . addDestConnToDB ( routeToken , & connInfo { conn : conn } ) return nil }
ConnectToDestination connects to a destination node using the provided IP
ConnectToDestination connects to a destination node using the provided IP
//Send code for route request