Disallow TRANSFER_PRIVS transactions if the sending account has a penalty. Again, there will be no penalties until the algo runs, so it's safe without a feature trigger.

This commit is contained in:
CalDescent 2022-12-04 11:54:05 +00:00
parent f14cc374c6
commit f4d20e42f3
2 changed files with 6 additions and 0 deletions

View File

@ -245,6 +245,7 @@ public abstract class Transaction {
ADDRESS_BLOCKED(96),
NAME_BLOCKED(97),
GROUP_APPROVAL_REQUIRED(98),
ACCOUNT_NOT_TRANSFERABLE(99),
INVALID_BUT_OK(999),
NOT_YET_RELEASED(1000);

View File

@ -67,6 +67,11 @@ public class TransferPrivsTransaction extends Transaction {
if (getSender().getConfirmedBalance(Asset.QORT) < this.transferPrivsTransactionData.getFee())
return ValidationResult.NO_BALANCE;
// Check sender doesn't have a blocksMintedPenalty, as these accounts cannot be transferred
AccountData senderAccountData = this.repository.getAccountRepository().getAccount(getSender().getAddress());
if (senderAccountData == null || senderAccountData.getBlocksMintedPenalty() != 0)
return ValidationResult.ACCOUNT_NOT_TRANSFERABLE;
return ValidationResult.OK;
}