Skip to content

Commit

Permalink
Tor: Remove Constants
Browse files Browse the repository at this point in the history
  • Loading branch information
alvasw committed Aug 20, 2023
1 parent 6426741 commit bb30246
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 62 deletions.
56 changes: 0 additions & 56 deletions network/tor/tor/src/main/java/bisq/tor/Constants.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public Socket getSocket(@Nullable String streamId) throws IOException {
}

public Socks5Proxy getSocks5Proxy(@Nullable String streamId) throws IOException {
Socks5Proxy socks5Proxy = new Socks5Proxy(Constants.LOCALHOST, socksPort);
Socks5Proxy socks5Proxy = new Socks5Proxy("127.0.0.1", socksPort);
socks5Proxy.resolveAddrLocally(false);
if (streamId == null) {
return socks5Proxy;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

package bisq.tor.installer;

import bisq.tor.Constants;
import lombok.Getter;

import java.io.File;
Expand All @@ -33,7 +32,7 @@ public class TorInstallationFiles {
public TorInstallationFiles(Path torDirPath) {
torDir = torDirPath.toFile();
torBinary = new File(torDir, "tor");
torrcFile = new File(torDir, Constants.TORRC);
versionFile = new File(torDir, Constants.VERSION);
torrcFile = new File(torDir, "torrc");
versionFile = new File(torDir, "version");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

package bisq.tor.onionservice;

import bisq.tor.Constants;
import bisq.tor.OnionAddress;
import bisq.tor.controller.NativeTorController;
import lombok.extern.slf4j.Slf4j;
Expand All @@ -30,6 +29,8 @@

@Slf4j
public class OnionServicePublishService {
private static final String HS_DIR_NANE = "hiddenservice";

private final NativeTorController nativeTorController;
private final Path torDirPath;
private Optional<OnionServiceDataDirManager> onionDataDirManager = Optional.empty();
Expand All @@ -55,7 +56,7 @@ public synchronized CompletableFuture<OnionAddress> initialize(String nodeId, in

onionDataDirManager = Optional.of(
new OnionServiceDataDirManager(
torDirPath.resolve(Constants.HS_DIR).resolve(nodeId)
torDirPath.resolve(HS_DIR_NANE).resolve(nodeId)
)
);
onionDataDirManager.ifPresent(dataDirManager -> dataDirManager.persist(result));
Expand Down

0 comments on commit bb30246

Please sign in to comment.