func ForwardRoute(client *lndwrapper.Lnd, db *DB, route *Route, address [4]byte) {
	log.Println("Forwarding route:")
	PrintRoute(route)
	connInfo := db.getPeerConn(address)
	serializedRoute, _ := createForwardRouteMessage(route)
	nonce := getNonce(connInfo.baseIV, connInfo.seqNumber)
	encryptedRoute := encryptAES(connInfo.sessionKey, nonce, serializedRoute)
	encryptedRouteLength := uint16(len(encryptedRoute))
	encryptedRouteLengthBytes := make([]byte, 2)
	binary.BigEndian.PutUint16(encryptedRouteLengthBytes, encryptedRouteLength)
	encryptedMessage := append(encryptedRouteLengthBytes, encryptedRoute...)
	_, err := connInfo.conn.Write(encryptedMessage)
	if err != nil {
		log.Println("Error writing:", err)
	}

	//Increment seqNumber to be used on the next message
	incrementSeqNumber(connInfo)
}
//ForwardRoute forwards the route to the node identificated by the LDR address
ForwardRoute forwards the route to the node identificated by the LDR address
// ForwardRoute forwards the route to the node identificated by the LDR address
func ForwardRoute(client *lndwrapper.Lnd, db *DB, route *Route, address [4]byte) {
	log.Println("Forwarding route:")
	PrintRoute(route)
	connInfo := db.getPeerConn(address)
	serializedRoute, _ := createForwardRouteMessage(route)
	nonce := getNonce(connInfo.baseIV, connInfo.seqNumber)
	encryptedRoute := encryptAES(connInfo.sessionKey, nonce, serializedRoute)
	encryptedRouteLength := uint16(len(encryptedRoute))
	encryptedRouteLengthBytes := make([]byte, 2)
	binary.BigEndian.PutUint16(encryptedRouteLengthBytes, encryptedRouteLength)
	encryptedMessage := append(encryptedRouteLengthBytes, encryptedRoute...)
	_, err := connInfo.conn.Write(encryptedMessage)
	if err != nil {
		log.Println("Error writing:", err)
	}
	incrementSeqNumber(connInfo)
}
func ForwardRoute ( client * lndwrapper . Lnd , db * DB , route * Route , address [ 4 ] byte ) { log . Println ( " " ) PrintRoute ( route ) connInfo := db . getPeerConn ( address ) serializedRoute , _ := createForwardRouteMessage ( route ) nonce := getNonce ( connInfo . baseIV , connInfo . seqNumber ) encryptedRoute := encryptAES ( connInfo . sessionKey , nonce , serializedRoute ) encryptedRouteLength := uint16 ( len ( encryptedRoute ) ) encryptedRouteLengthBytes := make ( [ ] byte , 2 ) binary . BigEndian . PutUint16 ( encryptedRouteLengthBytes , encryptedRouteLength ) encryptedMessage := append ( encryptedRouteLengthBytes , encryptedRoute ... ) _ , err := connInfo . conn . Write ( encryptedMessage ) if err != nil { log . Println ( " " , err ) } incrementSeqNumber ( connInfo ) }
ForwardRoute forwards the route to the node identificated by the LDR address
ForwardRoute forwards the route to the node identificated by the LDR address
//Increment seqNumber to be used on the next message