From 3b825263a7c0c9171ff7e527446ab4e52eb57309 Mon Sep 17 00:00:00 2001 From: Zlatin Balevsky Date: Fri, 8 May 2020 17:37:06 +0100 Subject: [PATCH] Make the random port selection range match that of the I2P router --- core/src/main/groovy/com/muwire/core/Core.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/groovy/com/muwire/core/Core.groovy b/core/src/main/groovy/com/muwire/core/Core.groovy index b055f9a5..c119706d 100644 --- a/core/src/main/groovy/com/muwire/core/Core.groovy +++ b/core/src/main/groovy/com/muwire/core/Core.groovy @@ -173,7 +173,7 @@ public class Core { && i2pOptions.containsKey("i2np.udp.port") )) { Random r = new Random() - int port = r.nextInt(60000) + 4000 + int port = 9151 + r.nextInt(1 + 30777 - 9151) // this range matches what the i2p router would choose i2pOptions["i2np.ntcp.port"] = String.valueOf(port) i2pOptions["i2np.udp.port"] = String.valueOf(port) i2pOptionsFile.withOutputStream { i2pOptions.store(it, "") }