Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert to only check local BTC node's port #4067

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 8 additions & 32 deletions core/src/main/java/bisq/core/app/BisqSetup.java
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ default void onRequestWalletPassword() {

@Setter
@Nullable
private Consumer<Runnable> displayTacHandler, displayLocalNodeMisconfigurationHandler;
private Consumer<Runnable> displayTacHandler;
@Setter
@Nullable
private Consumer<String> cryptoSetupFailedHandler, chainFileLockedExceptionHandler,
Expand Down Expand Up @@ -343,25 +343,21 @@ public void start() {
UserThread.runPeriodically(() -> {
}, 1);
maybeReSyncSPVChain();
maybeShowTac();
maybeShowTac(this::step2);
}

private void step2() {
maybeCheckLocalBitcoinNode(this::step3);
}

private void step3() {
torSetup.cleanupTorFiles();
readMapsFromResources(this::step4);
readMapsFromResources(this::step3);
checkCryptoSetup();
checkForCorrectOSArchitecture();
}

private void step4() {
startP2pNetworkAndWallet(this::step5);
private void step3() {
startP2pNetworkAndWallet(this::step4);
}

private void step5() {
private void step4() {
initDomainServices();

bisqSetupListeners.forEach(BisqSetupListener::onSetupComplete);
Expand Down Expand Up @@ -469,36 +465,16 @@ private void maybeReSyncSPVChain() {
}
}

private void maybeShowTac() {
private void maybeShowTac(Runnable nextStep) {
if (!preferences.isTacAcceptedV120() && !DevEnv.isDevMode()) {
if (displayTacHandler != null)
displayTacHandler.accept(() -> {
preferences.setTacAcceptedV120(true);
step2();
nextStep.run();
});
} else {
step2();
}
}

private void maybeCheckLocalBitcoinNode(Runnable nextStep) {
if (localBitcoinNode.shouldBeIgnored()) {
nextStep.run();
return;
}

// Here we only want to provide the user with a choice (in a popup) in case a
// local node is detected, but badly configured.
if (localBitcoinNode.isDetectedButMisconfigured()) {
if (displayLocalNodeMisconfigurationHandler != null) {
displayLocalNodeMisconfigurationHandler.accept(nextStep);
return;
} else {
log.error("displayLocalNodeMisconfigurationHandler undefined", new RuntimeException());
}
}

nextStep.run();
}

private void readMapsFromResources(Runnable nextStep) {
Expand Down
Loading