check for balance before deleting trade wallet
This commit is contained in:
parent
20b55ed9dd
commit
2ee2b747f9
@ -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 New Issue
Block a user