mirror of
https://github.com/retoaccess1/haveno-reto.git
synced 2024-11-10 05:03:35 +01: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()));
|
||||
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
|
||||
@ -1299,15 +1310,6 @@ public abstract class Trade implements Tradable, Model {
|
||||
xmrWalletService.removeWalletListener(idlePayoutSyncer);
|
||||
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(() -> {
|
||||
if (tradeStateSubscription != null) tradeStateSubscription.unsubscribe();
|
||||
if (tradePhaseSubscription != null) tradePhaseSubscription.unsubscribe();
|
||||
|
Loading…
Reference in New Issue
Block a user