Fix wrong network ID for dash

This commit is contained in:
Manfred Karrer 2018-03-06 18:35:34 -05:00
parent 9974aea867
commit ea8cbc111c
No known key found for this signature in database
GPG Key ID: 401250966A6B2C46

View File

@ -33,8 +33,7 @@ public class CoreSeedNodesRepository implements SeedNodesRepository {
List<String> bannedNodes = bisqEnvironment.getBannedSeedNodes(); List<String> bannedNodes = bisqEnvironment.getBannedSeedNodes();
Set<NodeAddress> nodeAddresses; Set<NodeAddress> nodeAddresses;
if (seedNodes != null && !seedNodes.isEmpty()) { if (seedNodes != null && !seedNodes.isEmpty()) {
nodeAddresses = Arrays.asList(StringUtils.deleteWhitespace(seedNodes).split(",")) nodeAddresses = Arrays.stream(StringUtils.deleteWhitespace(seedNodes).split(","))
.stream()
.map(NodeAddress::new) .map(NodeAddress::new)
.collect(Collectors.toSet()); .collect(Collectors.toSet());
} else { } else {
@ -116,8 +115,8 @@ public class CoreSeedNodesRepository implements SeedNodesRepository {
new NodeAddress("pklgy3vdfn3obkur.onion:8003"), new NodeAddress("pklgy3vdfn3obkur.onion:8003"),
// DASH mainnet // DASH mainnet
new NodeAddress("toeu5ikb27ydscxt.onion:8009"), new NodeAddress("toeu5ikb27ydscxt.onion:8006"),
new NodeAddress("ae4yvaivhnekkhqf.onion:8009") new NodeAddress("ae4yvaivhnekkhqf.onion:8006")
); );
// Addresses are used if the last digit of their port match the network id: // Addresses are used if the last digit of their port match the network id:
@ -163,6 +162,6 @@ public class CoreSeedNodesRepository implements SeedNodesRepository {
public boolean isSeedNode(NodeAddress nodeAddress) { public boolean isSeedNode(NodeAddress nodeAddress) {
return Stream.concat(localhostSeedNodeAddresses.stream(), torSeedNodeAddresses.stream()) return Stream.concat(localhostSeedNodeAddresses.stream(), torSeedNodeAddresses.stream())
.filter(e -> e.equals(nodeAddress)).findAny().isPresent(); .anyMatch(e -> e.equals(nodeAddress));
} }
} }