fix regtest public server preference regression

This commit is contained in:
Craig Raw 2022-01-05 12:41:14 +02:00
parent fd9e19d052
commit f1b3f7d5dd

View file

@ -359,9 +359,11 @@ public class ServerPreferencesController extends PreferencesDetailController {
});
PublicElectrumServer configPublicElectrumServer = PublicElectrumServer.fromUrl(config.getPublicElectrumServer());
if(configPublicElectrumServer == null) {
if(configPublicElectrumServer == null && PublicElectrumServer.supportedNetwork()) {
List<PublicElectrumServer> servers = PublicElectrumServer.getServers();
if(!servers.isEmpty()) {
publicElectrumServer.setValue(servers.get(new Random().nextInt(servers.size())));
}
} else {
publicElectrumServer.setValue(configPublicElectrumServer);
}