Make the random port selection range match that of the I2P router

This commit is contained in:
Zlatin Balevsky
2020-05-08 17:37:06 +01:00
parent e1bf6c0821
commit 3b825263a7

View File

@ -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, "") }