mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-07-22 22:51:02 -04:00
skip polling if shut down started after acquiring lock
This commit is contained in:
parent
98130499a7
commit
3648c1eb0e
2 changed files with 15 additions and 9 deletions
|
@ -2637,6 +2637,9 @@ public abstract class Trade extends XmrWalletBase implements Tradable, Model {
|
||||||
// poll wallet
|
// poll wallet
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
// skip if shut down started
|
||||||
|
if (isShutDownStarted) return;
|
||||||
|
|
||||||
// skip if payout unlocked
|
// skip if payout unlocked
|
||||||
if (isPayoutUnlocked()) return;
|
if (isPayoutUnlocked()) return;
|
||||||
|
|
||||||
|
|
|
@ -1994,6 +1994,9 @@ public class XmrWalletService extends XmrWalletBase {
|
||||||
// poll wallet
|
// poll wallet
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
// skip if shut down started
|
||||||
|
if (isShutDownStarted) return;
|
||||||
|
|
||||||
// skip if daemon not synced
|
// skip if daemon not synced
|
||||||
MoneroDaemonInfo lastInfo = xmrConnectionService.getLastInfo();
|
MoneroDaemonInfo lastInfo = xmrConnectionService.getLastInfo();
|
||||||
if (lastInfo == null) {
|
if (lastInfo == null) {
|
||||||
|
@ -2059,20 +2062,20 @@ public class XmrWalletService extends XmrWalletBase {
|
||||||
pollInProgress = false;
|
pollInProgress = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
saveWalletWithDelay();
|
||||||
|
}
|
||||||
|
|
||||||
// cache wallet info last
|
// cache wallet info last
|
||||||
synchronized (walletLock) {
|
synchronized (walletLock) {
|
||||||
if (wallet != null && !isShutDownStarted) {
|
if (wallet != null && !isShutDownStarted) {
|
||||||
try {
|
try {
|
||||||
cacheWalletInfo();
|
cacheWalletInfo();
|
||||||
saveWalletWithDelay();
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.warn("Error caching wallet info: " + e.getMessage() + "\n", e);
|
log.warn("Error caching wallet info: " + e.getMessage() + "\n", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private MoneroSyncResult syncMainWallet() {
|
private MoneroSyncResult syncMainWallet() {
|
||||||
synchronized (walletLock) {
|
synchronized (walletLock) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue