From 6a9d0b60a33d1cc1de96a553296199a0fa0f99d2 Mon Sep 17 00:00:00 2001 From: reger Date: Mon, 1 Apr 2013 03:51:57 +0200 Subject: [PATCH] make sure configured port is reported on recreated mySeed.txt --- source/net/yacy/peers/Seed.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/source/net/yacy/peers/Seed.java b/source/net/yacy/peers/Seed.java index 454186b35..04291049f 100644 --- a/source/net/yacy/peers/Seed.java +++ b/source/net/yacy/peers/Seed.java @@ -919,11 +919,7 @@ public class Seed implements Cloneable, Comparable, Comparator } public static Seed genLocalSeed(final SeedDB db) { - return genLocalSeed(db, 0, null); // an anonymous peer - } - - public static Seed genLocalSeed(final SeedDB db, final int port, final String name) { - // generate a seed for the local peer + // generate a seed for the local peer (as anonymous peer) // this is the birthplace of a seed, that then will start to travel to other peers final String hashs = ASCII.String(bestGap(db)); @@ -932,8 +928,9 @@ public class Seed implements Cloneable, Comparable, Comparator final Seed newSeed = new Seed(hashs); // now calculate other information about the host - newSeed.dna.put(Seed.NAME, (name) == null ? defaultPeerName() : name); - newSeed.dna.put(Seed.PORT, Integer.toString((port <= 0) ? 8090 : port)); + final long port = Switchboard.getSwitchboard().getConfigLong("port", 8090); //get port from config + newSeed.dna.put(Seed.NAME, defaultPeerName() ); + newSeed.dna.put(Seed.PORT, Long.toString(port)); return newSeed; }