mirror of
https://github.com/haveno-dex/haveno.git
synced 2024-10-01 01:35:48 -04:00
save trade wallet on shutdown with timeout
This commit is contained in:
parent
b88bec580e
commit
847e9e8701
@ -1275,6 +1275,17 @@ public abstract class Trade implements Tradable, Model {
|
|||||||
shutDownThreads.add(() -> ThreadUtils.shutDown(getConnectionChangedThreadId()));
|
shutDownThreads.add(() -> ThreadUtils.shutDown(getConnectionChangedThreadId()));
|
||||||
ThreadUtils.awaitTasks(shutDownThreads);
|
ThreadUtils.awaitTasks(shutDownThreads);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// save wallet
|
||||||
|
if (wallet != null) {
|
||||||
|
try {
|
||||||
|
xmrWalletService.saveWallet(wallet, false); // skip backup
|
||||||
|
stopWallet();
|
||||||
|
} catch (Exception e) {
|
||||||
|
// warning will be logged for main wallet, so skip logging here
|
||||||
|
//log.warn("Error closing monero-wallet-rpc subprocess for {} {}: {}. Was Haveno stopped manually with ctrl+c?", getClass().getSimpleName(), getId(), e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// shut down trade with timeout
|
// shut down trade with timeout
|
||||||
@ -1299,15 +1310,6 @@ public abstract class Trade implements Tradable, Model {
|
|||||||
xmrWalletService.removeWalletListener(idlePayoutSyncer);
|
xmrWalletService.removeWalletListener(idlePayoutSyncer);
|
||||||
idlePayoutSyncer = null;
|
idlePayoutSyncer = null;
|
||||||
}
|
}
|
||||||
if (wallet != null) {
|
|
||||||
try {
|
|
||||||
xmrWalletService.saveWallet(wallet, false); // skip backup
|
|
||||||
stopWallet();
|
|
||||||
} catch (Exception e) {
|
|
||||||
// warning will be logged for main wallet, so skip logging here
|
|
||||||
//log.warn("Error closing monero-wallet-rpc subprocess for {} {}: {}. Was Haveno stopped manually with ctrl+c?", getClass().getSimpleName(), getId(), e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
UserThread.execute(() -> {
|
UserThread.execute(() -> {
|
||||||
if (tradeStateSubscription != null) tradeStateSubscription.unsubscribe();
|
if (tradeStateSubscription != null) tradeStateSubscription.unsubscribe();
|
||||||
if (tradePhaseSubscription != null) tradePhaseSubscription.unsubscribe();
|
if (tradePhaseSubscription != null) tradePhaseSubscription.unsubscribe();
|
||||||
|
Loading…
Reference in New Issue
Block a user