func ConnectToPeersAuto(client *lndwrapper.Lnd, db *DB) {

	var neighborIPs []string
	var err error

	neighbors := GetLocalNodeNeighboursPubKeys(client)

	// Get IP for each neighbor
	for _, neighbor := range neighbors {

		// Check if node is registered in the protocol
		if db.IsNodeRegistered(neighbor) {
			//If it is we get the IP's for this node and try and connect to it
			neighborIPs = GetNodeIPs(client, neighbor)
			for _, ipAddress := range neighborIPs {
				log.Println("Trying to connect to", PubKeyArrayToString(neighbor), "@", neighborIPs[0]+DefaultPort)
				err = ConnectToPeer(client, db, ipAddress+":"+DefaultPort)
				if err != nil {
					log.Println(err)
				} else {
					break
				}
			}
		}
	}
}
//ConnectToPeersAuto - Connects to peers connects to peers automatically by trying to use
//their lightning nodes ip addresses
Connects to peers connects to peers automatically by trying to use
their lightning nodes ip addresses
// ConnectToPeersAuto - Connects to peers connects to peers automatically by trying to use // their lightning nodes ip addresses
func ConnectToPeersAuto(client *lndwrapper.Lnd, db *DB) {
	var neighborIPs []string
	var err error
	neighbors := GetLocalNodeNeighboursPubKeys(client)
	for _, neighbor := range neighbors {
		if db.IsNodeRegistered(neighbor) {
			neighborIPs = GetNodeIPs(client, neighbor)
			for _, ipAddress := range neighborIPs {
				log.Println("Trying to connect to", PubKeyArrayToString(neighbor), "@", neighborIPs[0]+DefaultPort)
				err = ConnectToPeer(client, db, ipAddress+":"+DefaultPort)
				if err != nil {
					log.Println(err)
				} else {
					break
				}
			}
		}
	}
}
func ConnectToPeersAuto ( client * lndwrapper . Lnd , db * DB ) { var neighborIPs [ ] string var err error neighbors := GetLocalNodeNeighboursPubKeys ( client ) for _ , neighbor := range neighbors { if db . IsNodeRegistered ( neighbor ) { neighborIPs = GetNodeIPs ( client , neighbor ) for _ , ipAddress := range neighborIPs { log . Println ( " " , PubKeyArrayToString ( neighbor ) , " " , neighborIPs [ 0 ] + DefaultPort ) err = ConnectToPeer ( client , db , ipAddress + " " + DefaultPort ) if err != nil { log . Println ( err ) } else { break } } } } }
Connects to peers connects to peers automatically by trying to use
their lightning nodes ip addresses
Connects to peers connects to peers automatically by trying to use their lightning nodes ip addresses
// Get IP for each neighbor // Check if node is registered in the protocol //If it is we get the IP's for this node and try and connect to it