Skip to content

Commit

Permalink
Cleanup tor dir if all connections lost
Browse files Browse the repository at this point in the history
  • Loading branch information
chimp1984 committed Nov 10, 2020
1 parent 1a1618d commit 7f83d1b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion seednode/src/main/java/bisq/seednode/SeedNodeMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

package bisq.seednode;

import bisq.core.app.TorSetup;
import bisq.core.app.misc.ExecutableForAppWithP2p;
import bisq.core.app.misc.ModuleForAppWithP2p;

Expand Down Expand Up @@ -152,7 +153,11 @@ private void setupConnectionLossCheck() {

checkConnectionLossTime = UserThread.runPeriodically(() -> {
if (injector.getInstance(PeerManager.class).getNumAllConnectionsLostEvents() > 1) {
shutDown(this);
// Removing cache files help in case the node got flagged from Tor's dos protection
injector.getInstance(TorSetup.class).cleanupTorFiles(() -> {
log.info("Tor directory reset");
shutDown(this);
}, log::error);
}
}, CHECK_CONNECTION_LOSS_SEC);

Expand Down

0 comments on commit 7f83d1b

Please sign in to comment.