diff --git a/gui/src/main/java/io/bitsquare/gui/main/settings/network/NetworkSettingsView.java b/gui/src/main/java/io/bitsquare/gui/main/settings/network/NetworkSettingsView.java index 3108e693cf..22c26a3f46 100644 --- a/gui/src/main/java/io/bitsquare/gui/main/settings/network/NetworkSettingsView.java +++ b/gui/src/main/java/io/bitsquare/gui/main/settings/network/NetworkSettingsView.java @@ -29,6 +29,7 @@ import io.bitsquare.p2p.NodeAddress; import io.bitsquare.p2p.P2PService; import io.bitsquare.p2p.P2PServiceListener; import io.bitsquare.p2p.network.LocalhostNetworkNode; +import io.bitsquare.p2p.network.OutboundConnection; import io.bitsquare.p2p.seed.SeedNodesRepository; import io.bitsquare.user.Preferences; import javafx.beans.value.ChangeListener; @@ -46,6 +47,7 @@ import javax.inject.Inject; import java.time.Duration; import java.util.List; import java.util.Set; +import java.util.stream.Collectors; @FxmlView public class NetworkSettingsView extends ActivatableViewAndModel { @@ -157,7 +159,7 @@ public class NetworkSettingsView extends ActivatableViewAndModel { - if (p2PPeersTextArea.getText().length() > 0) - p2PPeersTextArea.appendText("\n"); - p2PPeersTextArea.appendText(e.getFullAddress()); - if (seedNodeAddresses.contains(e)) - p2PPeersTextArea.appendText(" (Seed node)"); - }); + p2PPeersTextArea.setText(p2PService.getNetworkNode().getConfirmedConnections() + .stream() + .map(connection -> { + if (connection.getPeersNodeAddressOptional().isPresent()) { + NodeAddress nodeAddress = connection.getPeersNodeAddressOptional().get(); + return nodeAddress.getFullAddress() + " (" + + (connection instanceof OutboundConnection ? "outbound" : "inbound") + + (seedNodeAddresses.contains(nodeAddress) ? " / seed node)" : ")"); + } else { + // Should never be the case + return ""; + } + }) + .collect(Collectors.joining("\n"))); } private void updateBitcoinPeersTextArea() {