mirror of
https://github.com/boldsuck/haveno.git
synced 2024-12-22 20:19:21 +00:00
clear basic trade process data on payout unlocked
This commit is contained in:
parent
948be8ce29
commit
74cfd474ad
1 changed files with 20 additions and 1 deletions
|
@ -595,7 +595,7 @@ public abstract class Trade implements Tradable, Model {
|
|||
|
||||
// check if done
|
||||
if (isPayoutUnlocked()) {
|
||||
if (walletExists()) deleteWallet();
|
||||
maybeClearProcessData();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -662,6 +662,7 @@ public abstract class Trade implements Tradable, Model {
|
|||
if (!isInitialized) return;
|
||||
log.info("Payout unlocked for {} {}, deleting multisig wallet", getClass().getSimpleName(), getId());
|
||||
deleteWallet();
|
||||
maybeClearProcessData();
|
||||
if (idlePayoutSyncer != null) {
|
||||
xmrWalletService.removeWalletListener(idlePayoutSyncer);
|
||||
idlePayoutSyncer = null;
|
||||
|
@ -1144,6 +1145,24 @@ public abstract class Trade implements Tradable, Model {
|
|||
return payoutAmountFromMediation < normalPayoutAmount;
|
||||
}
|
||||
|
||||
public void maybeClearProcessData() {
|
||||
synchronized (walletLock) {
|
||||
|
||||
// skip if already cleared
|
||||
if (!walletExists()) return;
|
||||
|
||||
// delete trade wallet
|
||||
deleteWallet();
|
||||
|
||||
// TODO: clear other process data
|
||||
setPayoutTxHex(null);
|
||||
for (TradePeer peer : getPeers()) {
|
||||
peer.setUnsignedPayoutTxHex(null);
|
||||
peer.setUpdatedMultisigHex(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void maybeClearSensitiveData() {
|
||||
String change = "";
|
||||
if (removeAllChatMessages()) {
|
||||
|
|
Loading…
Reference in a new issue