forked from Qortal/qortal
Updated group transactions (owner check)
This commit is contained in:
parent
ea1d4dd962
commit
a140805c36
@ -70,6 +70,10 @@ public class CancelGroupBanTransaction extends Transaction {
|
||||
if (!this.repository.getGroupRepository().adminExists(groupId, admin.getAddress()))
|
||||
return ValidationResult.NOT_GROUP_ADMIN;
|
||||
|
||||
// Can't unban if not group's current owner
|
||||
if (!admin.getAddress().equals(groupData.getOwner()))
|
||||
return ValidationResult.INVALID_GROUP_OWNER;
|
||||
|
||||
Account member = getMember();
|
||||
|
||||
// Check ban actually exists
|
||||
|
@ -70,6 +70,10 @@ public class GroupBanTransaction extends Transaction {
|
||||
if (!this.repository.getGroupRepository().adminExists(groupId, admin.getAddress()))
|
||||
return ValidationResult.NOT_GROUP_ADMIN;
|
||||
|
||||
// Can't ban if not group's current owner
|
||||
if (!admin.getAddress().equals(groupData.getOwner()))
|
||||
return ValidationResult.INVALID_GROUP_OWNER;
|
||||
|
||||
Account offender = getOffender();
|
||||
|
||||
// Can't ban group owner
|
||||
|
@ -82,6 +82,10 @@ public class GroupKickTransaction extends Transaction {
|
||||
if (!admin.getAddress().equals(groupData.getOwner()) && groupRepository.adminExists(groupId, member.getAddress()))
|
||||
return ValidationResult.INVALID_GROUP_OWNER;
|
||||
|
||||
// Can't kick if not group's current owner
|
||||
if (!admin.getAddress().equals(groupData.getOwner()))
|
||||
return ValidationResult.INVALID_GROUP_OWNER;
|
||||
|
||||
// Check creator has enough funds
|
||||
if (admin.getConfirmedBalance(Asset.QORT) < this.groupKickTransactionData.getFee())
|
||||
return ValidationResult.NO_BALANCE;
|
||||
|
@ -83,6 +83,10 @@ public class UpdateGroupTransaction extends Transaction {
|
||||
|
||||
Account owner = getOwner();
|
||||
|
||||
// Check creator is group's current owner
|
||||
if (!owner.getAddress().equals(groupData.getOwner()))
|
||||
return ValidationResult.INVALID_GROUP_OWNER;
|
||||
|
||||
// Check creator has enough funds
|
||||
if (owner.getConfirmedBalance(Asset.QORT) < this.updateGroupTransactionData.getFee())
|
||||
return ValidationResult.NO_BALANCE;
|
||||
|
Loading…
Reference in New Issue
Block a user