diff --git a/source/net/yacy/peers/Seed.java b/source/net/yacy/peers/Seed.java index 8493d24ed..b7a31df9f 100644 --- a/source/net/yacy/peers/Seed.java +++ b/source/net/yacy/peers/Seed.java @@ -318,13 +318,13 @@ public class Seed implements Cloneable, Comparable, Comparator } /** - * try to get the IP
+ * try to get the public IP
* - * @return the IP or null + * @return the IP or localhost IP (127.0.0.1) */ public final String getIP() { - final String ip = get(Seed.IP, Domains.LOCALHOST); - return (ip == null || ip.isEmpty()) ? Domains.LOCALHOST : ip; + final String ip = this.dna.get(Seed.IP); + return (ip == null || ip.isEmpty()) ? Domains.LOCALHOST : ip; // not public (but leave as is for now 2014-08-24) } /** diff --git a/source/net/yacy/peers/SeedDB.java b/source/net/yacy/peers/SeedDB.java index 1a450a810..c932386f1 100644 --- a/source/net/yacy/peers/SeedDB.java +++ b/source/net/yacy/peers/SeedDB.java @@ -208,7 +208,11 @@ public final class SeedDB implements AlternativeDomainNames { System.exit(-1); } } - this.mySeed.setIP(""); // we delete the old information to see what we have now + if (Switchboard.getSwitchboard().isIntranetMode()) { + this.mySeed.setIP(Domains.myPublicLocalIP().getHostAddress()); // in intranet mode host address is best choice (to become senior peer) + } else { + this.mySeed.setIP("");// we delete the old information to see what we have now + } this.mySeed.put(Seed.PEERTYPE, Seed.PEERTYPE_VIRGIN); // markup startup condition }