mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-04-20 07:46:05 -04:00
Use localhost port ending in net id digit
Otherwise ``SeedNodesRepository`` ignores the address and peers fail to connect to the seed node.
This commit is contained in:
parent
59f66f8ef9
commit
fe9b3ec5f6
@ -114,7 +114,13 @@ public class NetworkStressTest {
|
||||
|
||||
@NotNull
|
||||
private static NodeAddress getSeedNodeAddress() {
|
||||
return new NodeAddress("localhost", Utils.findFreeSystemPort());
|
||||
// The address is only considered by ``SeedNodesRepository`` if
|
||||
// it ends in the digit matching the network identifier.
|
||||
int port;
|
||||
do {
|
||||
port = Utils.findFreeSystemPort();
|
||||
} while (port % 10 != REGTEST_NETWORK_ID);
|
||||
return new NodeAddress("localhost", port);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
Loading…
x
Reference in New Issue
Block a user