From c57ccfa0dfe98e5de2f3e2fd6fec3001a7435bf8 Mon Sep 17 00:00:00 2001 From: idk Date: Mon, 6 Nov 2023 01:44:42 +0000 Subject: [PATCH] Revert "Merge branch 'i2p.i2p.2.4.0-or-2.5.0-delete-hostnames-from-terminal' into 'master'" --- .../src/net/i2p/client/naming/LookupDest.java | 41 ++++--------------- 1 file changed, 8 insertions(+), 33 deletions(-) diff --git a/core/java/src/net/i2p/client/naming/LookupDest.java b/core/java/src/net/i2p/client/naming/LookupDest.java index 9c3274a01..d6b311163 100644 --- a/core/java/src/net/i2p/client/naming/LookupDest.java +++ b/core/java/src/net/i2p/client/naming/LookupDest.java @@ -96,23 +96,6 @@ public class LookupDest { return rv; } - private static boolean deleteHostname(I2PAppContext ctx, String hostname) { - try { - Destination dest = lookupHostname(I2PAppContext.getGlobalContext(), hostname); - if (dest == null) - System.err.println("Destination not found!"); - else { - NamingService ns = I2PAppContext.getGlobalContext().namingService(); - if (ns != null) - return ns.remove(hostname, dest); - System.err.print("ns is null"); - } - } catch (I2PSessionException ise) { - ise.printStackTrace(); - } - return false; - } - /** * @since 0.9.40 split out from above */ @@ -147,22 +130,14 @@ public class LookupDest { System.err.println("Usage: LookupDest hostname|b32"); System.exit(1); } - if (args[0].length() == 1) { - try { - Destination dest = lookupHostname(I2PAppContext.getGlobalContext(), args[0]); - if (dest == null) - System.err.println("Destination not found!"); - else - System.out.println(dest.toBase64()); - } catch (I2PSessionException ise) { - ise.printStackTrace(); - } + try { + Destination dest = lookupHostname(I2PAppContext.getGlobalContext(), args[0]); + if (dest == null) + System.err.println("Destination not found!"); + else + System.out.println(dest.toBase64()); + } catch (I2PSessionException ise) { + ise.printStackTrace(); } - if (args[0].length() == 2) { - if (args[0] == "-d") { - deleteHostname(I2PAppContext.getGlobalContext(), args[1]); - } - } - } }