Add missing fee check to TRANSFER_PRIVS

This commit is contained in:
catbref
2020-05-19 08:25:53 +01:00
parent 72100fe1d8
commit 032c5d0d07
2 changed files with 32 additions and 0 deletions

View File

@@ -7,6 +7,7 @@ import java.util.List;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.qortal.account.Account;
import org.qortal.asset.Asset;
import org.qortal.block.BlockChain;
import org.qortal.crypto.Crypto;
import org.qortal.data.account.AccountData;
@@ -60,6 +61,10 @@ public class TransferPrivsTransaction extends Transaction {
if (this.repository.getAccountRepository().accountExists(this.transferPrivsTransactionData.getRecipient()))
return ValidationResult.ACCOUNT_ALREADY_EXISTS;
// Check sender has funds for fee
if (getSender().getConfirmedBalance(Asset.QORT) < this.transferPrivsTransactionData.getFee())
return ValidationResult.NO_BALANCE;
return ValidationResult.OK;
}