mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-01-31 23:32:16 +00:00
Handle null hostNames in DnsDiscovery (some NP have that).
This commit is contained in:
parent
c9d411e8e7
commit
518b7edcbd
@ -67,6 +67,9 @@ public class DnsDiscovery implements PeerDiscovery {
|
||||
}
|
||||
|
||||
public InetSocketAddress[] getPeers(long timeoutValue, TimeUnit timeoutUnit) throws PeerDiscoveryException {
|
||||
if (hostNames == null)
|
||||
throw new PeerDiscoveryException("Unable to find any peers via DNS");
|
||||
|
||||
// Java doesn't have an async DNS API so we have to do all lookups in a thread pool, as sometimes seeds go
|
||||
// hard down and it takes ages to give up and move on.
|
||||
ExecutorService threadPool = Executors.newFixedThreadPool(hostNames.length);
|
||||
|
Loading…
Reference in New Issue
Block a user