From 23a7fb3d169ec86419d85fd8c3f4757dd5614a63 Mon Sep 17 00:00:00 2001 From: woodser Date: Wed, 10 Jul 2024 11:01:25 -0400 Subject: [PATCH] cache wallet info last on poll --- .../haveno/core/xmr/wallet/XmrWalletService.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) 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 682aafdb490..11668929c23 100644 --- a/core/src/main/java/haveno/core/xmr/wallet/XmrWalletService.java +++ b/core/src/main/java/haveno/core/xmr/wallet/XmrWalletService.java @@ -1845,9 +1845,6 @@ private void doPollWallet(boolean updateTxs) { } } } - - // cache wallet info - cacheWalletInfo(); } catch (Exception e) { if (wallet == null || isShutDownStarted) return; boolean isConnectionRefused = e.getMessage() != null && e.getMessage().contains("Connection refused"); @@ -1857,6 +1854,15 @@ else if (isWalletConnectedToDaemon()) { //e.printStackTrace(); } } finally { + + // cache wallet info last + if (wallet != null && !isShutDownStarted) { + try { + cacheWalletInfo(); + } catch (Exception e) { + e.printStackTrace(); + } + } pollInProgress = false; } }