mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-02-15 03:35:52 +00:00
Fix Tor support does not use all available HTTP seeds.
This commit is contained in:
parent
2c8ffc84ec
commit
a12ec7f49d
@ -337,9 +337,12 @@ public class PeerGroup implements TransactionBroadcaster {
|
||||
HttpDiscovery.Details[] httpSeeds = params.getHttpSeeds();
|
||||
if (httpSeeds.length > 0) {
|
||||
// Use HTTP discovery when Tor is active and there is a Cartographer seed, for a much needed speed boost.
|
||||
OkHttpClient client = new OkHttpClient();
|
||||
client.setSocketFactory(torClient.getSocketFactory());
|
||||
result.addPeerDiscovery(new HttpDiscovery(params, httpSeeds[0], client));
|
||||
OkHttpClient httpClient = new OkHttpClient();
|
||||
httpClient.setSocketFactory(torClient.getSocketFactory());
|
||||
List<PeerDiscovery> discoveries = Lists.newArrayList();
|
||||
for (HttpDiscovery.Details httpSeed : httpSeeds)
|
||||
discoveries.add(new HttpDiscovery(params, httpSeed, httpClient));
|
||||
result.addPeerDiscovery(new MultiplexingDiscovery(params, discoveries));
|
||||
} else {
|
||||
result.addPeerDiscovery(new TorDiscovery(params, torClient));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user