From cfaca6e0d89c022ffc679d2f7bd0f4f90bc9eeb8 Mon Sep 17 00:00:00 2001 From: woodser Date: Mon, 20 Nov 2023 15:44:35 -0500 Subject: [PATCH] fetch txs on startup to fix balance with 0 conf PaymentReceivedMsg --- .../src/main/java/haveno/core/xmr/wallet/XmrWalletService.java | 3 +++ 1 file changed, 3 insertions(+) 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 c4250d0816..b7c04973bb 100644 --- a/core/src/main/java/haveno/core/xmr/wallet/XmrWalletService.java +++ b/core/src/main/java/haveno/core/xmr/wallet/XmrWalletService.java @@ -682,6 +682,8 @@ public class XmrWalletService { // sync wallet and register listener if (wallet != null) { log.info("Monero wallet uri={}, path={}", wallet.getRpcConnection().getUri(), wallet.getPath()); + + // sync main wallet if applicable if (sync && numAttempts > 0) { try { @@ -692,6 +694,7 @@ public class XmrWalletService { wasWalletSynced = true; log.info("Done syncing main wallet in " + (System.currentTimeMillis() - time) + " ms"); wallet.startSyncing(connectionsService.getRefreshPeriodMs()); + wallet.getTxs(new MoneroTxQuery().setIsLocked(true)); // TODO: main wallet's balance does update on startup with 0 conf PaymentReceivedMessage until pool txs fetched? if (getMoneroNetworkType() != MoneroNetworkType.MAINNET) log.info("Monero wallet balance={}, unlocked balance={}", wallet.getBalance(0), wallet.getUnlockedBalance(0)); // reapply connection after wallet synced