Skip to content

Commit

Permalink
Merge pull request #1078 from alvasw/native_tor_add_is_hs_available
Browse files Browse the repository at this point in the history
NativeTorController: Add isHiddenServiceAvailable
  • Loading branch information
alvasw authored Aug 2, 2023
2 parents a5bd84d + 6513b84 commit fb687e0
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,15 @@ public TorControlConnection.CreateHiddenServiceResult createHiddenService(
return result;
}

public boolean isHiddenServiceAvailable(String onionUrl) {
try {
TorControlConnection controlConnection = torControlConnection.orElseThrow();
return controlConnection.isHSAvailable(onionUrl);
} catch (IOException e) {
return false;
}
}

public void waitUntilBootstrapped() {
try {
boolean isSuccess = isBootstrappedCountdownLatch.await(2, TimeUnit.MINUTES);
Expand Down

0 comments on commit fb687e0

Please sign in to comment.