Author: Jogy
Date: 2006-05-18 12:59:53 +0000 (Thu, 18 May 2006)
New Revision: 8763

Modified:
   trunk/freenet/src/freenet/clients/http/DarknetConnectionsToadlet.java
   trunk/freenet/src/freenet/node/Node.java
Log:
being scrupulously...

Modified: trunk/freenet/src/freenet/clients/http/DarknetConnectionsToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/DarknetConnectionsToadlet.java       
2006-05-18 12:22:47 UTC (rev 8762)
+++ trunk/freenet/src/freenet/clients/http/DarknetConnectionsToadlet.java       
2006-05-18 12:59:53 UTC (rev 8763)
@@ -106,8 +106,8 @@

                int numberOfConnected = 0;
                int numberOfBackedOff = 0;
+               int numberOfTooNew = 0;
                int numberOfIncompatible = 0;
-               int numberOfTooNew = 0;
                int numberOfDisconnected = 0;

                // Create array
@@ -358,7 +358,11 @@
                                this.sendErrorPage(ctx, 200, "Failed to add 
node", "Unable to parse the given text: <pre>"+ref+"</pre> as a node reference: 
"+e1+". Please <a href=\".\">Try again</a>.");
                                return;
                        }
-                       if(pn.getIdentity()==node.getIndentity() || 
!this.node.addDarknetConnection(pn)) {
+                       if(pn.getIdentity()==node.getIdentity()) {
+                               this.sendErrorPage(ctx, 200, "Referencing to 
self", "You can't add your own node to the list of remote peers. Return to the 
connections page <a href=\".\">here</a>.");
+                               return;
+                       }
+                       if(!this.node.addDarknetConnection(pn)) {
                                this.sendErrorPage(ctx, 200, "Failed to add 
node", "We already have the given reference. Return to the connections page <a 
href=\".\">here</a>.");
                                return;
                        }

Modified: trunk/freenet/src/freenet/node/Node.java
===================================================================
--- trunk/freenet/src/freenet/node/Node.java    2006-05-18 12:22:47 UTC (rev 
8762)
+++ trunk/freenet/src/freenet/node/Node.java    2006-05-18 12:59:53 UTC (rev 
8763)
@@ -2601,7 +2601,7 @@
                return this.bindto;
        }

-       public int getIndentity(){
+       public int getIdentity(){
                return Fields.hashCode(identityHash);
        }



Reply via email to