Fixed validation of existing reward share transactions.

This commit is contained in:
CalDescent 2022-12-31 14:43:37 +00:00
parent 166f9bd079
commit 6b45901c47
3 changed files with 15 additions and 4 deletions

View File

@ -76,7 +76,8 @@ public class BlockChain {
disableReferenceTimestamp,
increaseOnlineAccountsDifficultyTimestamp,
onlineAccountMinterLevelValidationHeight,
selfSponsorshipAlgoV1Height;
selfSponsorshipAlgoV1Height,
feeValidationFixTimestamp;
}
// Custom transaction fees
@ -501,6 +502,10 @@ public class BlockChain {
return this.featureTriggers.get(FeatureTrigger.onlineAccountMinterLevelValidationHeight.name()).intValue();
}
public long getFeeValidationFixTimestamp() {
return this.featureTriggers.get(FeatureTrigger.feeValidationFixTimestamp.name()).longValue();
}
// More complex getters for aspects that change by height or timestamp

View File

@ -164,6 +164,11 @@ public class RewardShareTransaction extends Transaction {
}
// Check creator has enough funds
if (this.rewardShareTransactionData.getTimestamp() >= BlockChain.getInstance().getFeeValidationFixTimestamp())
if (creator.getConfirmedBalance(Asset.QORT) < this.rewardShareTransactionData.getFee())
return ValidationResult.NO_BALANCE;
else if (!(isRecipientAlsoMinter && existingRewardShareData == null))
if (creator.getConfirmedBalance(Asset.QORT) < this.rewardShareTransactionData.getFee())
return ValidationResult.NO_BALANCE;

View File

@ -83,7 +83,8 @@
"disableReferenceTimestamp": 1655222400000,
"increaseOnlineAccountsDifficultyTimestamp": 9999999999999,
"onlineAccountMinterLevelValidationHeight": 1092000,
"selfSponsorshipAlgoV1Height": 1092400
"selfSponsorshipAlgoV1Height": 1092400,
"feeValidationFixTimestamp": 1671918000000
},
"genesisInfo": {
"version": 4,