Collection<PeerSocketAddress> socketAddresses = new ArrayList<PeerSocketAddress>(relays.size());
synchronized (relays) {
for (BaseRelayConnection relay : relays) {
PeerAddress pa = relay.relayAddress();
socketAddresses.add(new PeerSocketAddress(pa.inetAddress(), pa.tcpPort(), pa.udpPort()));
}
}
// update firewalled and isRelayed flags
PeerAddress newAddress = peer.peerAddress().changeFirewalledTCP(!hasRelays).changeFirewalledUDP(!hasRelays)