mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-11-04 21:36:45 +00:00
append tor debug output to test results
This commit is contained in:
parent
68344e981c
commit
32ab53ba03
1 changed files with 12 additions and 5 deletions
|
@ -414,17 +414,15 @@ public class ServerPreferencesController extends PreferencesDetailController {
|
||||||
torService.setPeriod(Duration.hours(1000));
|
torService.setPeriod(Duration.hours(1000));
|
||||||
torService.setRestartOnFailure(false);
|
torService.setRestartOnFailure(false);
|
||||||
|
|
||||||
torService.setOnRunning(workerStateEvent -> {
|
|
||||||
testResults.setText(testResults.getText() + "\nStarting Tor...");
|
|
||||||
});
|
|
||||||
torService.setOnSucceeded(workerStateEvent -> {
|
torService.setOnSucceeded(workerStateEvent -> {
|
||||||
Tor.setDefault(torService.getValue());
|
Tor.setDefault(torService.getValue());
|
||||||
torService.cancel();
|
torService.cancel();
|
||||||
testResults.setText(testResults.getText() + "\nTor started");
|
testResults.appendText("\nTor running, connecting to " + Config.get().getServerAddress() + "...");
|
||||||
startElectrumConnection();
|
startElectrumConnection();
|
||||||
});
|
});
|
||||||
torService.setOnFailed(workerStateEvent -> {
|
torService.setOnFailed(workerStateEvent -> {
|
||||||
testResults.setText(testResults.getText() + "\nTor failed to start");
|
torService.cancel();
|
||||||
|
testResults.appendText("\nTor failed to start");
|
||||||
showConnectionFailure(workerStateEvent.getSource().getException());
|
showConnectionFailure(workerStateEvent.getSource().getException());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -766,4 +764,13 @@ public class ServerPreferencesController extends PreferencesDetailController {
|
||||||
connectionService.cancel();
|
connectionService.cancel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Subscribe
|
||||||
|
public void torStatus(TorStatusEvent event) {
|
||||||
|
Platform.runLater(() -> {
|
||||||
|
if(torService != null && torService.isRunning()) {
|
||||||
|
testResults.appendText("\n" + event.getStatus());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue