Removed check from poll tx that creator is owner

This commit is contained in:
QuickMythril 2023-04-15 09:11:27 -04:00
parent 23ec71d7be
commit 57485bfe36

View File

@ -51,21 +51,6 @@ public class CreatePollTransaction extends Transaction {
if (!Crypto.isValidAddress(this.createPollTransactionData.getOwner())) if (!Crypto.isValidAddress(this.createPollTransactionData.getOwner()))
return ValidationResult.INVALID_ADDRESS; return ValidationResult.INVALID_ADDRESS;
Account creator = getCreator();
Account owner = getOwner();
String creatorAddress = creator.getAddress();
String ownerAddress = owner.getAddress();
// Check Owner address is the same as the creator public key
if (!creatorAddress.equals(ownerAddress)) {
return ValidationResult.INVALID_ADDRESS;
}
// Check creator has enough funds
if (creator.getConfirmedBalance(Asset.QORT) < this.createPollTransactionData.getFee())
return ValidationResult.NO_BALANCE;
// Check name size bounds // Check name size bounds
String pollName = this.createPollTransactionData.getPollName(); String pollName = this.createPollTransactionData.getPollName();
int pollNameLength = Utf8.encodedLength(pollName); int pollNameLength = Utf8.encodedLength(pollName);
@ -103,6 +88,12 @@ public class CreatePollTransaction extends Transaction {
optionNames.add(pollOptionData.getOptionName()); optionNames.add(pollOptionData.getOptionName());
} }
Account creator = getCreator();
// Check creator has enough funds
if (creator.getConfirmedBalance(Asset.QORT) < this.createPollTransactionData.getFee())
return ValidationResult.NO_BALANCE;
return ValidationResult.OK; return ValidationResult.OK;
} }