avoid server address resolution for public servers, and assume non local for failures where a proxy is configured

This commit is contained in:
Craig Raw
2025-04-06 20:55:35 +02:00
parent b777c8c64d
commit e31aa7fc80
3 changed files with 29 additions and 2 deletions
@@ -118,7 +118,8 @@ public class ElectrumServer {
previousServer = electrumServer;
HostAndPort hostAndPort = electrumServer.getHostAndPort();
boolean localNetworkAddress = !protocol.isOnionAddress(hostAndPort) && IpAddressMatcher.isLocalNetworkAddress(hostAndPort.getHost());
boolean localNetworkAddress = !Protocol.isOnionAddress(hostAndPort) && !PublicElectrumServer.isPublicServer(hostAndPort)
&& IpAddressMatcher.isLocalNetworkAddress(hostAndPort.getHost());
if(!localNetworkAddress && Config.get().isUseProxy() && proxyServer != null && !proxyServer.isBlank()) {
HostAndPort proxy = HostAndPort.fromString(proxyServer);