From f0fc83619cdd6e0b0a453f97292a08fe477b29ed Mon Sep 17 00:00:00 2001 From: Devin Bileck <603793+devinbileck@users.noreply.github.com> Date: Wed, 15 May 2019 23:14:55 -0700 Subject: [PATCH 1/2] Fix DAO synchronization text after restore from seed After restoring from seed, the text shown under DAO / BSQ Wallet / Transactions displays an incorrect progress - the numbers are swapped. For example: "Awaiting blocks... Verified 575,868 blocks out of 554,857" Normally we get the latest block height from BitcoinJ as the target height, and we request BSQ blocks from seed nodes up to latest block. But when restoring from seed, we receive the latest block height from the seed nodes while BitcoinJ has not received all blocks yet and is still syncing. Fixes https://github.com/bisq-network/bisq/issues/2825 --- .../desktop/main/dao/wallet/tx/BsqTxView.java | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/desktop/src/main/java/bisq/desktop/main/dao/wallet/tx/BsqTxView.java b/desktop/src/main/java/bisq/desktop/main/dao/wallet/tx/BsqTxView.java index 2cd6f06e2c9..803c54900b3 100644 --- a/desktop/src/main/java/bisq/desktop/main/dao/wallet/tx/BsqTxView.java +++ b/desktop/src/main/java/bisq/desktop/main/dao/wallet/tx/BsqTxView.java @@ -270,13 +270,23 @@ private void onUpdateAnyChainHeight() { chainSyncIndicator.setManaged(!synced); if (synced) { chainHeightLabel.setText(Res.get("dao.wallet.chainHeightSynced", - currentBlockHeight, - walletChainHeight)); + currentBlockHeight)); } else { chainSyncIndicator.setProgress(progress); - chainHeightLabel.setText(Res.get("dao.wallet.chainHeightSyncing", - currentBlockHeight, - walletChainHeight)); + if (walletChainHeight > currentBlockHeight) { + // Normally we get the latest block height from BitcoinJ as the target height, + // and we request BSQ blocks from seed nodes up to latest block + chainHeightLabel.setText(Res.get("dao.wallet.chainHeightSyncing", + currentBlockHeight, + walletChainHeight)); + } else { + // But when restoring from seed, we receive the latest block height + // from the seed nodes while BitcoinJ has not received all blocks yet and + // is still syncing + chainHeightLabel.setText(Res.get("dao.wallet.chainHeightSyncing", + walletChainHeight, + currentBlockHeight)); + } } } else { chainHeightLabel.setText(Res.get("dao.wallet.chainHeightSyncing", From 25d3d2d4241c69c08c5bef32a8939a3df0498b46 Mon Sep 17 00:00:00 2001 From: Devin Bileck <603793+devinbileck@users.noreply.github.com> Date: Wed, 15 May 2019 23:22:36 -0700 Subject: [PATCH 2/2] Update status text when BTC sync in progress Changes the status text when BTC sync in progress from: Synchronized with Bitcoin Mainnet (using Tor): 10.00% to: Synchronizing with Bitcoin Mainnet (using Tor): 10.00% --- core/src/main/java/bisq/core/app/WalletAppSetup.java | 2 +- core/src/main/resources/i18n/displayStrings.properties | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/bisq/core/app/WalletAppSetup.java b/core/src/main/java/bisq/core/app/WalletAppSetup.java index 0d9592ba70b..e89df28ab85 100644 --- a/core/src/main/java/bisq/core/app/WalletAppSetup.java +++ b/core/src/main/java/bisq/core/app/WalletAppSetup.java @@ -117,7 +117,7 @@ void init(@Nullable Consumer chainFileLockedExceptionHandler, } else if (percentage > 0.0) { result = Res.get("mainView.footer.btcInfo", peers, - Res.get("mainView.footer.btcInfo.synchronizedWith"), + Res.get("mainView.footer.btcInfo.synchronizingWith"), getBtcNetworkAsString() + ": " + formatter.formatToPercentWithSymbol(percentage)); } else { result = Res.get("mainView.footer.btcInfo", diff --git a/core/src/main/resources/i18n/displayStrings.properties b/core/src/main/resources/i18n/displayStrings.properties index f27c4fc8557..237b5b9d8f4 100644 --- a/core/src/main/resources/i18n/displayStrings.properties +++ b/core/src/main/resources/i18n/displayStrings.properties @@ -241,6 +241,7 @@ mainView.footer.localhostBitcoinNode=(localhost) mainView.footer.btcInfo=Bitcoin network peers: {0} / {1} {2} mainView.footer.btcInfo.initializing=Connecting to Bitcoin network mainView.footer.bsqInfo.synchronizing=/ Synchronizing DAO +mainView.footer.btcInfo.synchronizingWith=Synchronizing with mainView.footer.btcInfo.synchronizedWith=Synchronized with mainView.footer.btcInfo.connectingTo=Connecting to mainView.footer.btcInfo.connectionFailed=connection failed