mirror of
https://github.com/haveno-dex/haveno.git
synced 2024-11-17 00:07:49 +00:00
check for balance before deleting trade wallet
This commit is contained in:
parent
20b55ed9dd
commit
2ee2b747f9
1 changed files with 5 additions and 0 deletions
|
@ -905,6 +905,11 @@ public abstract class Trade implements Tradable, Model {
|
|||
throw new RuntimeException("Refusing to delete wallet for " + getClass().getSimpleName() + " " + getId() + " because the deposit txs have been published but payout tx has not unlocked");
|
||||
}
|
||||
|
||||
// check for balance
|
||||
if (wallet != null && wallet.getBalance().compareTo(BigInteger.ZERO) > 0) {
|
||||
throw new RuntimeException("Refusing to delete wallet for " + getClass().getSimpleName() + " " + getId() + " because it has a balance");
|
||||
}
|
||||
|
||||
// force stop the wallet
|
||||
if (wallet != null) stopWallet();
|
||||
|
||||
|
|
Loading…
Reference in a new issue