mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-12-23 20:36:44 +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.setRestartOnFailure(false);
|
||||
|
||||
torService.setOnRunning(workerStateEvent -> {
|
||||
testResults.setText(testResults.getText() + "\nStarting Tor...");
|
||||
});
|
||||
torService.setOnSucceeded(workerStateEvent -> {
|
||||
Tor.setDefault(torService.getValue());
|
||||
torService.cancel();
|
||||
testResults.setText(testResults.getText() + "\nTor started");
|
||||
testResults.appendText("\nTor running, connecting to " + Config.get().getServerAddress() + "...");
|
||||
startElectrumConnection();
|
||||
});
|
||||
torService.setOnFailed(workerStateEvent -> {
|
||||
testResults.setText(testResults.getText() + "\nTor failed to start");
|
||||
torService.cancel();
|
||||
testResults.appendText("\nTor failed to start");
|
||||
showConnectionFailure(workerStateEvent.getSource().getException());
|
||||
});
|
||||
|
||||
|
@ -766,4 +764,13 @@ public class ServerPreferencesController extends PreferencesDetailController {
|
|||
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