Source:
private void startP2pNetworkAndWallet(Runnable nextStep) { ChangeListener<Boolean> walletInitializedListener = (observable, oldValue, newValue) -> { if (newValue && !p2pNetworkReady.get() && displayTorNetworkSettingsHandler != null) displayTorNetworkSettingsHandler.accept(true); }; Timer startupTimeout = UserThread.runAfter(() -> { if (p2PNetworkSetup.p2pNetworkFailed.get() || walletsSetup.walletsSetupFailed.get()) { return; } log.warn("startupTimeout called"); if (walletsManager.areWalletsEncrypted()) walletInitialized.addListener(walletInitializedListener); else if (displayTorNetworkSettingsHandler != null) displayTorNetworkSettingsHandler.accept(true); log.info("Set log level for org.berndpruenster.netlayer classes to DEBUG to show more details for " + "Tor network connection issues"); Log.setCustomLogLevel("org.berndpruenster.netlayer", Level.DEBUG); }, STARTUP_TIMEOUT_MINUTES, TimeUnit.MINUTES); bisqSetupListeners.forEach(BisqSetupListener::onInitP2pNetwork); p2pNetworkReady = p2PNetworkSetup.init(this::initWallet, displayTorNetworkSettingsHandler); if (!preferences.getUseTorForBitcoinJ()) { initWallet(); } p2pNetworkAndWalletInitialized = EasyBind.combine(walletInitialized, p2pNetworkReady, (a, b) -> { log.info("walletInitialized={}, p2pNetWorkReady={}", a, b); return a && b; }); p2pNetworkAndWalletInitialized.subscribe((observable, oldValue, newValue) -> { if (newValue) { startupTimeout.stop(); walletInitialized.removeListener(walletInitializedListener); if (displayTorNetworkSettingsHandler != null) displayTorNetworkSettingsHandler.accept(false); nextStep.run(); } }); }

Target:
private void startP2pNetworkAndWallet(Runnable nextStep) { ChangeListener<Boolean> walletInitializedListener = (observable, oldValue, newValue) -> { if (newValue && !p2pNetworkReady.get() && displayTorNetworkSettingsHandler != null) displayTorNetworkSettingsHandler.accept(true); }; Timer startupTimeout = UserThread.runAfter(() -> { if (p2PNetworkSetup.p2pNetworkFailed.get() || walletsSetup.walletsSetupFailed.get()) { return; } log.warn("startupTimeout called"); if (walletsManager.areWalletsEncrypted()) walletInitialized.addListener(walletInitializedListener); else if (displayTorNetworkSettingsHandler != null) displayTorNetworkSettingsHandler.accept(true); log.info("Set log level for org.berndpruenster.netlayer classes to DEBUG to show more details for " + "Tor network connection issues"); Log.setCustomLogLevel("org.berndpruenster.netlayer", Level.DEBUG); }, STARTUP_TIMEOUT_MINUTES, TimeUnit.MINUTES); bisqSetupListeners.forEach(BisqSetupListener::onInitP2pNetwork); p2pNetworkReady = p2PNetworkSetup.init(this::initWallet, displayTorNetworkSettingsHandler); if (!preferences.getUseTorForBitcoinJ() || localBitcoinNode.shouldBeUsed()) { initWallet(); } p2pNetworkAndWalletInitialized = EasyBind.combine(walletInitialized, p2pNetworkReady, (a, b) -> { log.info("walletInitialized={}, p2pNetWorkReady={}", a, b); return a && b; }); p2pNetworkAndWalletInitialized.subscribe((observable, oldValue, newValue) -> { if (newValue) { startupTimeout.stop(); walletInitialized.removeListener(walletInitializedListener); if (displayTorNetworkSettingsHandler != null) displayTorNetworkSettingsHandler.accept(false); nextStep.run(); } }); }