Very slightly relax validity checks for TRANSFER_PRIVS to allow for skeletal account records, e.g. due to CHAT transactions, but account last reference still needs to be null. Example at block height 736196 / 7

This commit is contained in:
catbref 2022-02-24 09:13:51 +00:00
parent c333d18cd0
commit 8950bb7af9

View File

@ -58,7 +58,9 @@ public class TransferPrivsTransaction extends Transaction {
return ValidationResult.INVALID_ADDRESS; return ValidationResult.INVALID_ADDRESS;
// Check recipient is new account // Check recipient is new account
if (this.repository.getAccountRepository().accountExists(this.transferPrivsTransactionData.getRecipient())) AccountData recipientAccountData = this.repository.getAccountRepository().getAccount(this.transferPrivsTransactionData.getRecipient());
// Non-existent account data is OK, but if account data exists then reference needs to be null
if (recipientAccountData != null && recipientAccountData.getReference() != null)
return ValidationResult.ACCOUNT_ALREADY_EXISTS; return ValidationResult.ACCOUNT_ALREADY_EXISTS;
// Check sender has funds for fee // Check sender has funds for fee