From 84c08e4c36d8d3f67c7d607d6ef34ed800de4ca6 Mon Sep 17 00:00:00 2001 From: woodser Date: Tue, 28 Nov 2023 13:38:32 -0500 Subject: [PATCH] show that wallet is syncing on startup --- .../haveno/core/api/XmrConnectionService.java | 2 +- .../java/haveno/core/app/HavenoSetup.java | 5 ++ .../java/haveno/core/app/WalletAppSetup.java | 51 ++++++++++++------- .../core/xmr/wallet/XmrWalletService.java | 13 ++++- .../resources/i18n/displayStrings.properties | 6 ++- .../i18n/displayStrings_cs.properties | 4 +- .../i18n/displayStrings_de.properties | 4 +- .../i18n/displayStrings_es.properties | 4 +- .../i18n/displayStrings_fa.properties | 4 +- .../i18n/displayStrings_fr.properties | 4 +- .../i18n/displayStrings_it.properties | 2 - .../i18n/displayStrings_ja.properties | 4 +- .../i18n/displayStrings_pt-br.properties | 2 - .../i18n/displayStrings_pt.properties | 2 - .../i18n/displayStrings_ru.properties | 2 - .../i18n/displayStrings_th.properties | 2 - .../i18n/displayStrings_vi.properties | 2 - .../i18n/displayStrings_zh-hans.properties | 4 +- .../i18n/displayStrings_zh-hant.properties | 2 - .../haveno/desktop/main/MainViewModel.java | 6 +++ 20 files changed, 75 insertions(+), 50 deletions(-) diff --git a/core/src/main/java/haveno/core/api/XmrConnectionService.java b/core/src/main/java/haveno/core/api/XmrConnectionService.java index c3bc739fad..6e5854648d 100644 --- a/core/src/main/java/haveno/core/api/XmrConnectionService.java +++ b/core/src/main/java/haveno/core/api/XmrConnectionService.java @@ -569,7 +569,7 @@ public final class XmrConnectionService { long targetHeight = lastInfo.getTargetHeight(); long blocksLeft = targetHeight - lastInfo.getHeight(); if (syncStartHeight == null) syncStartHeight = lastInfo.getHeight(); - double percent = ((double) Math.max(1, lastInfo.getHeight() - syncStartHeight) / (double) (targetHeight - syncStartHeight)) * 100d; // grant at least 1 block to show progress + double percent = targetHeight == syncStartHeight ? 1.0 : ((double) Math.max(1, lastInfo.getHeight() - syncStartHeight) / (double) (targetHeight - syncStartHeight)) * 100d; // grant at least 1 block to show progress downloadListener.progress(percent, blocksLeft, null); } diff --git a/core/src/main/java/haveno/core/app/HavenoSetup.java b/core/src/main/java/haveno/core/app/HavenoSetup.java index 7a74a3bf81..b6cb549fc5 100644 --- a/core/src/main/java/haveno/core/app/HavenoSetup.java +++ b/core/src/main/java/haveno/core/app/HavenoSetup.java @@ -401,6 +401,7 @@ public class HavenoSetup { // reset startup timeout on progress getXmrDaemonSyncProgress().addListener((observable, oldValue, newValue) -> resetStartupTimeout()); + getXmrWalletSyncProgress().addListener((observable, oldValue, newValue) -> resetStartupTimeout()); log.info("Init P2P network"); havenoSetupListeners.forEach(HavenoSetupListener::onInitP2pNetwork); @@ -727,6 +728,10 @@ public class HavenoSetup { return walletAppSetup.getXmrDaemonSyncProgress(); } + public DoubleProperty getXmrWalletSyncProgress() { + return walletAppSetup.getXmrWalletSyncProgress(); + } + public StringProperty getWalletServiceErrorMsg() { return walletAppSetup.getWalletServiceErrorMsg(); } diff --git a/core/src/main/java/haveno/core/app/WalletAppSetup.java b/core/src/main/java/haveno/core/app/WalletAppSetup.java index 92410ff1a4..aa7244cb84 100644 --- a/core/src/main/java/haveno/core/app/WalletAppSetup.java +++ b/core/src/main/java/haveno/core/app/WalletAppSetup.java @@ -71,6 +71,8 @@ public class WalletAppSetup { @Getter private final DoubleProperty xmrDaemonSyncProgress = new SimpleDoubleProperty(-1); @Getter + private final DoubleProperty xmrWalletSyncProgress = new SimpleDoubleProperty(-1); + @Getter private final StringProperty walletServiceErrorMsg = new SimpleStringProperty(); @Getter private final StringProperty xmrSplashSyncIconId = new SimpleStringProperty(); @@ -117,29 +119,42 @@ public class WalletAppSetup { String result; if (exception == null && errorMsg == null) { - // TODO: update for daemon and wallet sync progress - double chainDownloadPercentageD = (double) chainDownloadPercentage; - xmrDaemonSyncProgress.set(chainDownloadPercentageD); - Long bestChainHeight = chainHeight == null ? null : (Long) chainHeight; - String chainHeightAsString = bestChainHeight != null && bestChainHeight > 0 ? - String.valueOf(bestChainHeight) : - ""; - if (chainDownloadPercentageD == 1) { - String synchronizedWith = Res.get("mainView.footer.xmrInfo.synchronizedWith", - getXmrNetworkAsString(), chainHeightAsString); + // update wallet sync progress + double walletDownloadPercentageD = (double) walletDownloadPercentage; + xmrWalletSyncProgress.set(walletDownloadPercentageD); + Long bestWalletHeight = walletHeight == null ? null : (Long) walletHeight; + String walletHeightAsString = bestWalletHeight != null && bestWalletHeight > 0 ? String.valueOf(bestWalletHeight) : ""; + if (walletDownloadPercentageD == 1) { + String synchronizedWith = Res.get("mainView.footer.xmrInfo.synchronizedWalletWith", getXmrNetworkAsString(), walletHeightAsString); String feeInfo = ""; // TODO: feeService.isFeeAvailable() returns true, disable result = Res.get("mainView.footer.xmrInfo", synchronizedWith, feeInfo); getXmrSplashSyncIconId().set("image-connection-synced"); downloadCompleteHandler.run(); - } else if (chainDownloadPercentageD > 0.0) { - String synchronizingWith = Res.get("mainView.footer.xmrInfo.synchronizingWith", - getXmrNetworkAsString(), chainHeightAsString, - FormattingUtils.formatToRoundedPercentWithSymbol(chainDownloadPercentageD)); - result = Res.get("mainView.footer.xmrInfo", synchronizingWith, ""); + } else if (walletDownloadPercentageD > 0) { + result = "Synchronizing wallet ..."; // TODO: support wallet progress updates and use below translation + // String synchronizingWith = Res.get("mainView.footer.xmrInfo.synchronizingWalletWith", getXmrNetworkAsString(), walletHeightAsString, FormattingUtils.formatToRoundedPercentWithSymbol(walletDownloadPercentageD)); + // result = Res.get("mainView.footer.xmrInfo", synchronizingWith, ""); + getXmrSplashSyncIconId().set(""); // clear synced icon } else { - result = Res.get("mainView.footer.xmrInfo", - Res.get("mainView.footer.xmrInfo.connectingTo"), - getXmrNetworkAsString()); + + // update daemon sync progress + double chainDownloadPercentageD = (double) chainDownloadPercentage; + xmrDaemonSyncProgress.set(chainDownloadPercentageD); + Long bestChainHeight = chainHeight == null ? null : (Long) chainHeight; + String chainHeightAsString = bestChainHeight != null && bestChainHeight > 0 ? String.valueOf(bestChainHeight) : ""; + if (chainDownloadPercentageD == 1) { + String synchronizedWith = Res.get("mainView.footer.xmrInfo.synchronizedDaemonWith", getXmrNetworkAsString(), chainHeightAsString); + String feeInfo = ""; // TODO: feeService.isFeeAvailable() returns true, disable + result = Res.get("mainView.footer.xmrInfo", synchronizedWith, feeInfo); + getXmrSplashSyncIconId().set("image-connection-synced"); + } else if (chainDownloadPercentageD > 0.0) { + String synchronizingWith = Res.get("mainView.footer.xmrInfo.synchronizingDaemonWith", getXmrNetworkAsString(), chainHeightAsString, FormattingUtils.formatToRoundedPercentWithSymbol(chainDownloadPercentageD)); + result = Res.get("mainView.footer.xmrInfo", synchronizingWith, ""); + } else { + result = Res.get("mainView.footer.xmrInfo", + Res.get("mainView.footer.xmrInfo.connectingTo"), + getXmrNetworkAsString()); + } } } else { result = Res.get("mainView.footer.xmrInfo", diff --git a/core/src/main/java/haveno/core/xmr/wallet/XmrWalletService.java b/core/src/main/java/haveno/core/xmr/wallet/XmrWalletService.java index 63372d9b66..335a867622 100644 --- a/core/src/main/java/haveno/core/xmr/wallet/XmrWalletService.java +++ b/core/src/main/java/haveno/core/xmr/wallet/XmrWalletService.java @@ -125,6 +125,7 @@ public class XmrWalletService { private final Map> txCache = new HashMap>(); private boolean isShutDownStarted = false; private ExecutorService syncWalletThreadPool = Executors.newFixedThreadPool(10); // TODO: adjust based on connection type + private Long syncStartHeight = null; @Inject XmrWalletService(Preferences preferences, @@ -724,9 +725,10 @@ public class XmrWalletService { // sync main wallet if applicable if (sync && numAttempts > 0) { try { - + // sync main wallet log.info("Syncing main wallet"); + updateSyncProgress(); long time = System.currentTimeMillis(); wallet.sync(); // blocking walletHeight.set(wallet.getHeight()); @@ -775,6 +777,15 @@ public class XmrWalletService { } } + private void updateSyncProgress() { + walletHeight.set(wallet.getHeight()); + long targetHeight = xmrConnectionService.getTargetHeight(); + long blocksLeft = targetHeight - walletHeight.get(); + if (syncStartHeight == null) syncStartHeight = walletHeight.get(); + double percent = targetHeight == syncStartHeight ? 1.0 : ((double) Math.max(1, walletHeight.get() - syncStartHeight) / (double) (targetHeight - syncStartHeight)) * 100d; // grant at least 1 block to show progress + downloadListener.progress(percent, blocksLeft, null); + } + private MoneroWalletRpc createWalletRpc(MoneroWalletConfig config, Integer port) { // must be connected to daemon diff --git a/core/src/main/resources/i18n/displayStrings.properties b/core/src/main/resources/i18n/displayStrings.properties index 0f4b6ed85f..cd6babb75a 100644 --- a/core/src/main/resources/i18n/displayStrings.properties +++ b/core/src/main/resources/i18n/displayStrings.properties @@ -268,8 +268,10 @@ mainView.footer.localhostMoneroNode=(localhost) mainView.footer.xmrInfo={0} {1} mainView.footer.xmrFeeRate=/ Fee rate: {0} sat/vB mainView.footer.xmrInfo.initializing=Connecting to Monero network -mainView.footer.xmrInfo.synchronizingWith=Synchronizing with {0} at block: {1} / {2} -mainView.footer.xmrInfo.synchronizedWith=Synced with {0} at block {1} +mainView.footer.xmrInfo.synchronizingDaemonWith=Synchronizing daemon with {0} at block: {1} / {2} +mainView.footer.xmrInfo.synchronizedDaemonWith=Daemon synchronized with {0} at block {1} +mainView.footer.xmrInfo.synchronizingWalletWith=Synchronizing wallet with {0} at block: {1} / {2} +mainView.footer.xmrInfo.synchronizedWalletWith=Wallet synchronized with {0} at block {1} mainView.footer.xmrInfo.connectingTo=Connecting to mainView.footer.xmrInfo.connectionFailed=Connection failed to mainView.footer.xmrPeers=Monero network peers: {0} diff --git a/core/src/main/resources/i18n/displayStrings_cs.properties b/core/src/main/resources/i18n/displayStrings_cs.properties index f7cc393923..83ca4639e6 100644 --- a/core/src/main/resources/i18n/displayStrings_cs.properties +++ b/core/src/main/resources/i18n/displayStrings_cs.properties @@ -249,8 +249,8 @@ mainView.footer.localhostMoneroNode=(localhost) mainView.footer.xmrInfo={0} {1} mainView.footer.xmrFeeRate=/ Aktuální poplatek: {0} sat/vB mainView.footer.xmrInfo.initializing=Připojování do Moneroové sítě -mainView.footer.xmrInfo.synchronizingWith=Synchronizace s {0} v bloku: {1} / {2} -mainView.footer.xmrInfo.synchronizedWith=Synchronizováno s {0} v bloku {1} +mainView.footer.xmrInfo.synchronizingDaemonWith=Synchronizace s {0} v bloku: {1} / {2} +mainView.footer.xmrInfo.synchronizedDaemonWith=Synchronizováno s {0} v bloku {1} mainView.footer.xmrInfo.connectingTo=Připojování mainView.footer.xmrInfo.connectionFailed=Připojení se nezdařilo mainView.footer.xmrPeers=Monero síťové nody: {0} diff --git a/core/src/main/resources/i18n/displayStrings_de.properties b/core/src/main/resources/i18n/displayStrings_de.properties index 9b866bcef4..639c52ca81 100644 --- a/core/src/main/resources/i18n/displayStrings_de.properties +++ b/core/src/main/resources/i18n/displayStrings_de.properties @@ -249,8 +249,8 @@ mainView.footer.localhostMoneroNode=(localhost) mainView.footer.xmrInfo={0} {1} mainView.footer.xmrFeeRate=/ Aktuelle Gebühr: {0} sat/vB mainView.footer.xmrInfo.initializing=Verbindung mit Monero-Netzwerk wird hergestellt -mainView.footer.xmrInfo.synchronizingWith=Synchronisierung mit {0} bei Block: {1} / {2} -mainView.footer.xmrInfo.synchronizedWith=Synchronisierung mit {0} bei Block {1} +mainView.footer.xmrInfo.synchronizingDaemonWith=Synchronisierung mit {0} bei Block: {1} / {2} +mainView.footer.xmrInfo.synchronizedDaemonWith=Synchronisierung mit {0} bei Block {1} mainView.footer.xmrInfo.connectingTo=Verbinde mit mainView.footer.xmrInfo.connectionFailed=Verbindung fehlgeschlagen zu mainView.footer.xmrPeers=Monero Netzwerk Peers: {0} diff --git a/core/src/main/resources/i18n/displayStrings_es.properties b/core/src/main/resources/i18n/displayStrings_es.properties index bfe3e9b60d..4e40ec8fb7 100644 --- a/core/src/main/resources/i18n/displayStrings_es.properties +++ b/core/src/main/resources/i18n/displayStrings_es.properties @@ -249,8 +249,8 @@ mainView.footer.localhostMoneroNode=(localhost) mainView.footer.xmrInfo={0} {1} mainView.footer.xmrFeeRate=/Tasas actuales: {0} sat/vB mainView.footer.xmrInfo.initializing=Conectando a la red Monero -mainView.footer.xmrInfo.synchronizingWith=Sincronizando con {0} en el bloque: {1} / {2} -mainView.footer.xmrInfo.synchronizedWith=Sincronizado con {0} en el bloque {1} +mainView.footer.xmrInfo.synchronizingDaemonWith=Sincronizando con {0} en el bloque: {1} / {2} +mainView.footer.xmrInfo.synchronizedDaemonWith=Sincronizado con {0} en el bloque {1} mainView.footer.xmrInfo.connectingTo=Conectando a mainView.footer.xmrInfo.connectionFailed=Conexión fallida a mainView.footer.xmrPeers=Pares de Monero: {0} diff --git a/core/src/main/resources/i18n/displayStrings_fa.properties b/core/src/main/resources/i18n/displayStrings_fa.properties index b14e0ecf5e..4b44399a5a 100644 --- a/core/src/main/resources/i18n/displayStrings_fa.properties +++ b/core/src/main/resources/i18n/displayStrings_fa.properties @@ -249,8 +249,8 @@ mainView.footer.localhostMoneroNode=(لوکال هاست) mainView.footer.xmrInfo={0} {1} mainView.footer.xmrFeeRate=/ Fee rate: {0} sat/vB mainView.footer.xmrInfo.initializing=در حال ارتباط با شبکه بیت‌کوین -mainView.footer.xmrInfo.synchronizingWith=Synchronizing with {0} at block: {1} / {2} -mainView.footer.xmrInfo.synchronizedWith=Synced with {0} at block {1} +mainView.footer.xmrInfo.synchronizingDaemonWith=Synchronizing with {0} at block: {1} / {2} +mainView.footer.xmrInfo.synchronizedDaemonWith=Synced with {0} at block {1} mainView.footer.xmrInfo.connectingTo=در حال ایجاد ارتباط با mainView.footer.xmrInfo.connectionFailed=Connection failed to mainView.footer.xmrPeers=Monero network peers: {0} diff --git a/core/src/main/resources/i18n/displayStrings_fr.properties b/core/src/main/resources/i18n/displayStrings_fr.properties index bd753a6d9f..1b973be3ee 100644 --- a/core/src/main/resources/i18n/displayStrings_fr.properties +++ b/core/src/main/resources/i18n/displayStrings_fr.properties @@ -249,8 +249,8 @@ mainView.footer.localhostMoneroNode=(localhost) mainView.footer.xmrInfo={0} {1} mainView.footer.xmrFeeRate=/ Taux des frais: {0} sat/vB mainView.footer.xmrInfo.initializing=Connexion au réseau Monero en cours -mainView.footer.xmrInfo.synchronizingWith=Synchronisation avec {0} au block: {1}/ {2} -mainView.footer.xmrInfo.synchronizedWith=Synchronisé avec {0} au block {1} +mainView.footer.xmrInfo.synchronizingDaemonWith=Synchronisation avec {0} au block: {1}/ {2} +mainView.footer.xmrInfo.synchronizedDaemonWith=Synchronisé avec {0} au block {1} mainView.footer.xmrInfo.connectingTo=Se connecte à mainView.footer.xmrInfo.connectionFailed=Échec de la connexion à mainView.footer.xmrPeers=Pairs du réseau Monero: {0} diff --git a/core/src/main/resources/i18n/displayStrings_it.properties b/core/src/main/resources/i18n/displayStrings_it.properties index 47a37a3b72..318345650c 100644 --- a/core/src/main/resources/i18n/displayStrings_it.properties +++ b/core/src/main/resources/i18n/displayStrings_it.properties @@ -249,8 +249,6 @@ mainView.footer.localhostMoneroNode=(localhost) mainView.footer.xmrInfo={0} {1} mainView.footer.xmrFeeRate=/ Fee rate: {0} sat/vB mainView.footer.xmrInfo.initializing=Connessione alla rete Monero -mainView.footer.xmrInfo.synchronizingWith=Synchronizing with {0} at block: {1} / {2} -mainView.footer.xmrInfo.synchronizedWith=Synced with {0} at block {1} mainView.footer.xmrInfo.connectingTo=Connessione a mainView.footer.xmrInfo.connectionFailed=Connessione fallita mainView.footer.xmrPeers=Monero network peers: {0} diff --git a/core/src/main/resources/i18n/displayStrings_ja.properties b/core/src/main/resources/i18n/displayStrings_ja.properties index d49776510c..8c282828f4 100644 --- a/core/src/main/resources/i18n/displayStrings_ja.properties +++ b/core/src/main/resources/i18n/displayStrings_ja.properties @@ -249,8 +249,8 @@ mainView.footer.localhostMoneroNode=(ローカルホスト) mainView.footer.xmrInfo={0} {1} mainView.footer.xmrFeeRate=/ 手数料率: {0} サトシ/vB mainView.footer.xmrInfo.initializing=ビットコインネットワークに接続中 -mainView.footer.xmrInfo.synchronizingWith={0}と同期中、ブロック: {1} / {2} -mainView.footer.xmrInfo.synchronizedWith={0}と同期されています、ブロック{1}に +mainView.footer.xmrInfo.synchronizingDaemonWith={0}と同期中、ブロック: {1} / {2} +mainView.footer.xmrInfo.synchronizedDaemonWith={0}と同期されています、ブロック{1}に mainView.footer.xmrInfo.connectingTo=接続中: mainView.footer.xmrInfo.connectionFailed=接続失敗 mainView.footer.xmrPeers=Moneroネットワークピア: {0} diff --git a/core/src/main/resources/i18n/displayStrings_pt-br.properties b/core/src/main/resources/i18n/displayStrings_pt-br.properties index 61ff156ff4..ff4bc19b4f 100644 --- a/core/src/main/resources/i18n/displayStrings_pt-br.properties +++ b/core/src/main/resources/i18n/displayStrings_pt-br.properties @@ -252,8 +252,6 @@ mainView.footer.localhostMoneroNode=(localhost) mainView.footer.xmrInfo={0} {1} mainView.footer.xmrFeeRate=/ Fee rate: {0} sat/vB mainView.footer.xmrInfo.initializing=Conectando-se à rede Monero -mainView.footer.xmrInfo.synchronizingWith=Synchronizing with {0} at block: {1} / {2} -mainView.footer.xmrInfo.synchronizedWith=Synced with {0} at block {1} mainView.footer.xmrInfo.connectingTo=Conectando-se a mainView.footer.xmrInfo.connectionFailed=Falha na conexão à mainView.footer.xmrPeers=Monero network peers: {0} diff --git a/core/src/main/resources/i18n/displayStrings_pt.properties b/core/src/main/resources/i18n/displayStrings_pt.properties index 0504ce09c2..7b9fc333f2 100644 --- a/core/src/main/resources/i18n/displayStrings_pt.properties +++ b/core/src/main/resources/i18n/displayStrings_pt.properties @@ -249,8 +249,6 @@ mainView.footer.localhostMoneroNode=(localhost) mainView.footer.xmrInfo={0} {1} mainView.footer.xmrFeeRate=/ Fee rate: {0} sat/vB mainView.footer.xmrInfo.initializing=Conectando à rede Monero -mainView.footer.xmrInfo.synchronizingWith=Synchronizing with {0} at block: {1} / {2} -mainView.footer.xmrInfo.synchronizedWith=Synced with {0} at block {1} mainView.footer.xmrInfo.connectingTo=Conectando à mainView.footer.xmrInfo.connectionFailed=Connection failed to mainView.footer.xmrPeers=Monero network peers: {0} diff --git a/core/src/main/resources/i18n/displayStrings_ru.properties b/core/src/main/resources/i18n/displayStrings_ru.properties index dd08443c3e..75a9f072a4 100644 --- a/core/src/main/resources/i18n/displayStrings_ru.properties +++ b/core/src/main/resources/i18n/displayStrings_ru.properties @@ -249,8 +249,6 @@ mainView.footer.localhostMoneroNode=(локальный узел) mainView.footer.xmrInfo={0} {1} mainView.footer.xmrFeeRate=/ Fee rate: {0} sat/vB mainView.footer.xmrInfo.initializing=Подключение к сети Биткойн -mainView.footer.xmrInfo.synchronizingWith=Synchronizing with {0} at block: {1} / {2} -mainView.footer.xmrInfo.synchronizedWith=Synced with {0} at block {1} mainView.footer.xmrInfo.connectingTo=Подключение к mainView.footer.xmrInfo.connectionFailed=Connection failed to mainView.footer.xmrPeers=Monero network peers: {0} diff --git a/core/src/main/resources/i18n/displayStrings_th.properties b/core/src/main/resources/i18n/displayStrings_th.properties index 644eb2000c..6203e5f353 100644 --- a/core/src/main/resources/i18n/displayStrings_th.properties +++ b/core/src/main/resources/i18n/displayStrings_th.properties @@ -249,8 +249,6 @@ mainView.footer.localhostMoneroNode=(แม่ข่ายเฉพาะที mainView.footer.xmrInfo={0} {1} mainView.footer.xmrFeeRate=/ Fee rate: {0} sat/vB mainView.footer.xmrInfo.initializing=Connecting to Monero network -mainView.footer.xmrInfo.synchronizingWith=Synchronizing with {0} at block: {1} / {2} -mainView.footer.xmrInfo.synchronizedWith=Synced with {0} at block {1} mainView.footer.xmrInfo.connectingTo=Connecting to mainView.footer.xmrInfo.connectionFailed=Connection failed to mainView.footer.xmrPeers=Monero network peers: {0} diff --git a/core/src/main/resources/i18n/displayStrings_vi.properties b/core/src/main/resources/i18n/displayStrings_vi.properties index 08bae4f12c..a12b210d1f 100644 --- a/core/src/main/resources/i18n/displayStrings_vi.properties +++ b/core/src/main/resources/i18n/displayStrings_vi.properties @@ -249,8 +249,6 @@ mainView.footer.localhostMoneroNode=(Máy chủ nội bộ) mainView.footer.xmrInfo={0} {1} mainView.footer.xmrFeeRate=/ Fee rate: {0} sat/vB mainView.footer.xmrInfo.initializing=Đang kết nối với mạng Monero -mainView.footer.xmrInfo.synchronizingWith=Synchronizing with {0} at block: {1} / {2} -mainView.footer.xmrInfo.synchronizedWith=Synced with {0} at block {1} mainView.footer.xmrInfo.connectingTo=Đang kết nối với mainView.footer.xmrInfo.connectionFailed=Connection failed to mainView.footer.xmrPeers=Monero network peers: {0} diff --git a/core/src/main/resources/i18n/displayStrings_zh-hans.properties b/core/src/main/resources/i18n/displayStrings_zh-hans.properties index b1a359231f..959594e0fd 100644 --- a/core/src/main/resources/i18n/displayStrings_zh-hans.properties +++ b/core/src/main/resources/i18n/displayStrings_zh-hans.properties @@ -249,8 +249,8 @@ mainView.footer.localhostMoneroNode=(本地主机) mainView.footer.xmrInfo={0} {1} mainView.footer.xmrFeeRate=/ 矿工手费率:{0} 聪/字节 mainView.footer.xmrInfo.initializing=连接至比特币网络 -mainView.footer.xmrInfo.synchronizingWith=正在通过{0}同步区块:{1}/{2} -mainView.footer.xmrInfo.synchronizedWith=已通过{0}同步至区块{1} +mainView.footer.xmrInfo.synchronizingDaemonWith=正在通过{0}同步区块:{1}/{2} +mainView.footer.xmrInfo.synchronizedDaemonWith=已通过{0}同步至区块{1} mainView.footer.xmrInfo.connectingTo=连接至 mainView.footer.xmrInfo.connectionFailed=连接失败: mainView.footer.xmrPeers=Monero网络节点:{0} diff --git a/core/src/main/resources/i18n/displayStrings_zh-hant.properties b/core/src/main/resources/i18n/displayStrings_zh-hant.properties index fcea1406c4..ab6348592b 100644 --- a/core/src/main/resources/i18n/displayStrings_zh-hant.properties +++ b/core/src/main/resources/i18n/displayStrings_zh-hant.properties @@ -249,8 +249,6 @@ mainView.footer.localhostMoneroNode=(本地主機) mainView.footer.xmrInfo={0} {1} mainView.footer.xmrFeeRate=/ Fee rate: {0} sat/vB mainView.footer.xmrInfo.initializing=連接至比特幣網絡 -mainView.footer.xmrInfo.synchronizingWith=Synchronizing with {0} at block: {1} / {2} -mainView.footer.xmrInfo.synchronizedWith=Synced with {0} at block {1} mainView.footer.xmrInfo.connectingTo=連接至 mainView.footer.xmrInfo.connectionFailed=連接失敗: mainView.footer.xmrPeers=Monero網絡節點:{0} diff --git a/desktop/src/main/java/haveno/desktop/main/MainViewModel.java b/desktop/src/main/java/haveno/desktop/main/MainViewModel.java index 1d27d26f48..e95ba03bab 100644 --- a/desktop/src/main/java/haveno/desktop/main/MainViewModel.java +++ b/desktop/src/main/java/haveno/desktop/main/MainViewModel.java @@ -423,6 +423,7 @@ public class MainViewModel implements ViewModel, HavenoSetup.HavenoSetupListener .show()); havenoSetup.getXmrDaemonSyncProgress().addListener((observable, oldValue, newValue) -> updateXmrDaemonSyncProgress()); + havenoSetup.getXmrWalletSyncProgress().addListener((observable, oldValue, newValue) -> updateXmrWalletSyncProgress()); havenoSetup.setFilterWarningHandler(warning -> new Popup().warning(warning).show()); @@ -539,6 +540,11 @@ public class MainViewModel implements ViewModel, HavenoSetup.HavenoSetupListener final DoubleProperty xmrDaemonSyncProgress = havenoSetup.getXmrDaemonSyncProgress(); combinedSyncProgress.set(xmrDaemonSyncProgress.doubleValue()); } + + private void updateXmrWalletSyncProgress() { + final DoubleProperty xmrWalletSyncProgress = havenoSetup.getXmrWalletSyncProgress(); + combinedSyncProgress.set(xmrWalletSyncProgress.doubleValue()); + } private void setupInvalidOpenOffersHandler() { openOfferManager.getInvalidOffers().addListener((ListChangeListener>) c -> {