Only connect to known nodes.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 22 May 2009 04:43:20 +0000 (06:43 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 22 May 2009 04:43:20 +0000 (06:43 +0200)
src/net/pterodactylus/jsite/core/NodeManager.java

index 8745cba..ac47628 100644 (file)
@@ -311,6 +311,10 @@ public class NodeManager implements Iterable<Node>, PropertyChangeListener {
         */
        public void connect(Node node) {
                logger.log(Level.FINEST, "connect(node=" + node + ")");
+               if (!nodes.contains(node)) {
+                       logger.log(Level.WARNING, "Was told to connect to node (" + node + ") I don’t know about!");
+                       return;
+               }
        }
 
        /**