Don’t reregister a USK if it already is registered.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 11 Feb 2013 21:24:08 +0000 (22:24 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 11 Feb 2013 21:24:08 +0000 (22:24 +0100)
src/main/java/net/pterodactylus/sone/core/SoneDownloader.java

index f493fdc..e0ee363 100644 (file)
@@ -97,10 +97,9 @@ public class SoneDownloader extends AbstractService {
         *            The Sone to add
         */
        public void addSone(Sone sone) {
-               if (!sones.add(sone)) {
-                       freenetInterface.unregisterUsk(sone);
+               if (sones.add(sone)) {
+                       freenetInterface.registerUsk(sone, this);
                }
-               freenetInterface.registerUsk(sone, this);
        }
 
        /**