Skip to content

Commit

Permalink
fetch txs on startup to fix balance with 0 conf PaymentReceivedMsg
Browse files Browse the repository at this point in the history
  • Loading branch information
woodser committed Nov 21, 2023
1 parent 013924b commit cfaca6e
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,8 @@ private void maybeInitMainWallet(boolean sync, int numAttempts) {
// 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 {

Expand All @@ -692,6 +694,7 @@ private void maybeInitMainWallet(boolean sync, int numAttempts) {
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
Expand Down

0 comments on commit cfaca6e

Please sign in to comment.