mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-23 15:00:30 +01:00
Fix formatting
This commit is contained in:
parent
a6ca8985f3
commit
1dea1a134a
1 changed files with 8 additions and 6 deletions
|
@ -127,12 +127,10 @@ public class BtcNodes {
|
|||
host = parts[0].replace("[", "").replace("]", "");
|
||||
if (parts.length == 2)
|
||||
port = Integer.parseInt(parts[1].replace(":", ""));
|
||||
}
|
||||
else if (parts[0].contains(":") && !parts[0].contains(".")) {
|
||||
} else if (parts[0].contains(":") && !parts[0].contains(".")) {
|
||||
// IPv6 address only; not delimited by square brackets
|
||||
host = parts[0];
|
||||
}
|
||||
else if (parts[0].contains(".")) {
|
||||
} else if (parts[0].contains(".")) {
|
||||
// address and an optional port number
|
||||
// e.g. 127.0.0.1:8333 or abcdef123xyz.onion:9999
|
||||
parts = fullAddress.split(":");
|
||||
|
@ -142,11 +140,15 @@ public class BtcNodes {
|
|||
port = Integer.parseInt(parts[1]);
|
||||
}
|
||||
|
||||
checkArgument(host.length()>0, "BtcNode address format not recognised");
|
||||
checkArgument(host.length() > 0, "BtcNode address format not recognised");
|
||||
return host.contains(".onion") ? new BtcNode(null, host, null, port, null) : new BtcNode(null, null, host, port, null);
|
||||
}
|
||||
|
||||
public BtcNode(@Nullable String hostName, @Nullable String onionAddress, @Nullable String address, int port, @Nullable String operator) {
|
||||
public BtcNode(@Nullable String hostName,
|
||||
@Nullable String onionAddress,
|
||||
@Nullable String address,
|
||||
int port,
|
||||
@Nullable String operator) {
|
||||
this.hostName = hostName;
|
||||
this.onionAddress = onionAddress;
|
||||
this.address = address;
|
||||
|
|
Loading…
Add table
Reference in a new issue