mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 09:52:23 +01:00
Use full address instead of hostname
Mixing usage of host name and full name caused a few bugs in the past. We should use only full address by default.
This commit is contained in:
parent
70a950ce94
commit
683301fc23
@ -107,7 +107,7 @@ public class ArbitratorService {
|
||||
.filter(data -> data.getProtectedStoragePayload() instanceof Arbitrator)
|
||||
.map(data -> (Arbitrator) data.getProtectedStoragePayload())
|
||||
.filter(a -> bannedArbitrators == null ||
|
||||
!bannedArbitrators.contains(a.getNodeAddress().getHostName()))
|
||||
!bannedArbitrators.contains(a.getNodeAddress().getFullAddress()))
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
Map<NodeAddress, Arbitrator> map = new HashMap<>();
|
||||
|
@ -60,13 +60,13 @@ public class ArbitratorSelection {
|
||||
.collect(Collectors.toList());
|
||||
|
||||
Set<String> arbitrators = arbitratorManager.getArbitratorsObservableMap().values().stream()
|
||||
.map(arbitrator -> arbitrator.getNodeAddress().getHostName())
|
||||
.map(arbitrator -> arbitrator.getNodeAddress().getFullAddress())
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
String result = getLeastUsedArbitrator(lastAddressesUsedInTrades, arbitrators);
|
||||
|
||||
Optional<Arbitrator> optionalArbitrator = arbitratorManager.getArbitratorsObservableMap().values().stream()
|
||||
.filter(e -> e.getNodeAddress().getHostName().equals(result))
|
||||
.filter(e -> e.getNodeAddress().getFullAddress().equals(result))
|
||||
.findAny();
|
||||
checkArgument(optionalArbitrator.isPresent(), "optionalArbitrator has to be present");
|
||||
return optionalArbitrator.get();
|
||||
|
@ -52,7 +52,7 @@ public class PublishTradeStatistics extends TradeTask {
|
||||
NodeAddress arbitratorNodeAddress = trade.getArbitratorNodeAddress();
|
||||
if (arbitratorNodeAddress != null) {
|
||||
// The first 4 chars are sufficient to identify an arbitrator
|
||||
String address = arbitratorNodeAddress.getHostName().substring(0, 4);
|
||||
String address = arbitratorNodeAddress.getFullAddress().substring(0, 4);
|
||||
extraDataMap.put(TradeStatistics2.ARBITRATOR_ADDRESS, address);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user