wallet poll requests connection changes off thread to avoid deadlock

This commit is contained in:
woodser 2025-07-01 17:44:27 -04:00 committed by woodser
parent 5ca44c40cf
commit e089a6f2a4

View file

@ -2061,7 +2061,7 @@ public class XmrWalletService extends XmrWalletBase {
if (System.currentTimeMillis() - lastLogPollErrorTimestamp > HavenoUtils.LOG_POLL_ERROR_PERIOD_MS) {
log.warn("Error polling main wallet's transactions from the pool: {}", e.getMessage());
lastLogPollErrorTimestamp = System.currentTimeMillis();
if (System.currentTimeMillis() - lastPollTxsTimestamp > POLL_TXS_TOLERANCE_MS) requestSwitchToNextBestConnection(sourceConnection);
if (System.currentTimeMillis() - lastPollTxsTimestamp > POLL_TXS_TOLERANCE_MS) ThreadUtils.submitToPool(() -> requestSwitchToNextBestConnection(sourceConnection));
}
}
}