Skip to content

Commit

Permalink
do not request connection change on trade poll error except rescan
Browse files Browse the repository at this point in the history
  • Loading branch information
woodser authored Jul 21, 2024
1 parent b03c873 commit 629e150
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions core/src/main/java/haveno/core/trade/Trade.java
Original file line number Diff line number Diff line change
Expand Up @@ -2546,7 +2546,12 @@ private void doPollWallet() {

// rescan spent outputs to detect unconfirmed payout tx
if (isPayoutExpected && wallet.getBalance().compareTo(BigInteger.ZERO) > 0) {
wallet.rescanSpent();
try {
wallet.rescanSpent();
} catch (Exception e) {
log.warn("Failed to rescan spent outputs for {} {}, errorMessage={}", getClass().getSimpleName(), getShortId(), e.getMessage());
ThreadUtils.execute(() -> requestSwitchToNextBestConnection(), getId()); // do not block polling thread
}
}

// get txs from trade wallet
Expand Down Expand Up @@ -2596,7 +2601,6 @@ else if (hasFailedTx && isPayoutPublished()) {
boolean isWalletConnected = isWalletConnectedToDaemon();
if (wallet != null && !isShutDownStarted && isWalletConnected) {
log.warn("Error polling trade wallet for {} {}, errorMessage={}. Monerod={}", getClass().getSimpleName(), getShortId(), e.getMessage(), getXmrWalletService().getConnectionService().getConnection());
ThreadUtils.execute(() -> requestSwitchToNextBestConnection(), getId()); // do not block polling thread
//e.printStackTrace();
}
}
Expand Down

0 comments on commit 629e150

Please sign in to comment.