bitcoinj 0.15: PeerAddress: Use InetSocketAddress constructor instead of InetAddress+port.

This commit is contained in:
Oscar Guindzberg 2019-04-16 13:03:37 -03:00
parent 4348f663ca
commit 3717323444
No known key found for this signature in database
GPG Key ID: 209796BF2E1D4F75

View File

@ -98,7 +98,7 @@ class BtcNodeConverter {
// Blocking call. takes about 600 ms ;-(
InetAddress lookupAddress = facade.torLookup(proxy, host);
InetSocketAddress address = new InetSocketAddress(lookupAddress, port);
return new PeerAddress(address.getAddress(), address.getPort());
return new PeerAddress(address);
} catch (Exception e) {
log.error("Failed to create peer address", e);
return null;
@ -109,7 +109,7 @@ class BtcNodeConverter {
private static PeerAddress create(String hostName, int port) {
try {
InetSocketAddress address = new InetSocketAddress(hostName, port);
return new PeerAddress(address.getAddress(), address.getPort());
return new PeerAddress(address);
} catch (Exception e) {
log.error("Failed to create peer address", e);
return null;