if myAddress null URI uri new URI http myAddress String host uri getHo

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
if (myAddress != null) {
URI uri = new URI("http://" + myAddress);
String host = uri.getHost();
if (!hallmark.getHost().equals(host)) {
throw new RuntimeException("Invalid hallmark host");
}
int myPort = uri.getPort() == -1 ? Peers.getDefaultPeerPort() : uri.getPort();
if (myPort != hallmark.getPort()) {
throw new RuntimeException("Invalid hallmark port");
}
}