From cf8de0843eaf490f0a6dbae8aa86f8cd5c6665c1 Mon Sep 17 00:00:00 2001 From: woodser Date: Mon, 13 Mar 2023 16:03:37 -0400 Subject: [PATCH] initialize wallet after p2p network ready --- core/src/main/java/haveno/core/app/HavenoSetup.java | 7 ------- core/src/main/java/haveno/core/app/P2PNetworkSetup.java | 4 ++-- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/core/src/main/java/haveno/core/app/HavenoSetup.java b/core/src/main/java/haveno/core/app/HavenoSetup.java index 2ae5ca2d..c39d08d5 100644 --- a/core/src/main/java/haveno/core/app/HavenoSetup.java +++ b/core/src/main/java/haveno/core/app/HavenoSetup.java @@ -420,13 +420,6 @@ public class HavenoSetup { havenoSetupListeners.forEach(HavenoSetupListener::onInitP2pNetwork); p2pNetworkReady = p2PNetworkSetup.init(this::initWallet, displayTorNetworkSettingsHandler); - // We only init wallet service here if not using Tor for bitcoinj. - // When using Tor, wallet init must be deferred until Tor is ready. - // TODO encapsulate below conditional inside getUseTorForBitcoinJ - if (!preferences.getUseTorForBitcoinJ() || localBitcoinNode.shouldBeUsed()) { - initWallet(); - } - // need to store it to not get garbage collected p2pNetworkAndWalletInitialized = EasyBind.combine(walletInitialized, p2pNetworkReady, (a, b) -> { diff --git a/core/src/main/java/haveno/core/app/P2PNetworkSetup.java b/core/src/main/java/haveno/core/app/P2PNetworkSetup.java index d520ea7b..31929a13 100644 --- a/core/src/main/java/haveno/core/app/P2PNetworkSetup.java +++ b/core/src/main/java/haveno/core/app/P2PNetworkSetup.java @@ -146,8 +146,8 @@ public class P2PNetworkSetup { bootstrapState.set(Res.get("mainView.bootstrapState.torNodeCreated")); p2PNetworkIconId.set("image-connection-tor"); - if (preferences.getUseTorForBitcoinJ()) - initWalletServiceHandler.run(); + // invoke handler to initialize wallet + initWalletServiceHandler.run(); // We want to get early connected to the price relay so we call it already now priceFeedService.setCurrencyCodeOnInit();