func ConnectToPeer(client *lndwrapper.Lnd, db *DB, ipAddress string) error {
	conn, err := net.Dial("tcp", ipAddress)
	if err != nil {
		return err
	}
	writeConnectionType(conn, peerConn)
	log.Println("Connected to:" + conn.RemoteAddr().String())
	sessionKey, baseIV, startSeq, peerLightningKey := offerPeerHandshake(conn, client, db)
	log.Println("Peer Handshake successful")

	go handlePeerConnection(conn, client, db, sessionKey, baseIV, startSeq, peerLightningKey)

	return nil
}
//ConnectToPeer connects to a peer
ConnectToPeer connects to a peer
// ConnectToPeer connects to a peer
func ConnectToPeer(client *lndwrapper.Lnd, db *DB, ipAddress string) error {
	conn, err := net.Dial("tcp", ipAddress)
	if err != nil {
		return err
	}
	writeConnectionType(conn, peerConn)
	log.Println("Connected to:" + conn.RemoteAddr().String())
	sessionKey, baseIV, startSeq, peerLightningKey := offerPeerHandshake(conn, client, db)
	log.Println("Peer Handshake successful")
	go handlePeerConnection(conn, client, db, sessionKey, baseIV, startSeq, peerLightningKey)
	return nil
}
func ConnectToPeer ( client * lndwrapper . Lnd , db * DB , ipAddress string ) error { conn , err := net . Dial ( " " , ipAddress ) if err != nil { return err } writeConnectionType ( conn , peerConn ) log . Println ( " " + conn . RemoteAddr ( ) . String ( ) ) sessionKey , baseIV , startSeq , peerLightningKey := offerPeerHandshake ( conn , client , db ) log . Println ( " " ) go handlePeerConnection ( conn , client , db , sessionKey , baseIV , startSeq , peerLightningKey ) return nil }
ConnectToPeer connects to a peer
ConnectToPeer connects to a peer