Added Rewardshare disabled

This commit is contained in:
AlphaX-Reloaded 2024-09-16 15:27:00 +02:00
parent 51664f0561
commit 885aa10395
22 changed files with 51 additions and 4 deletions

View File

@ -83,7 +83,8 @@ public class BlockChain {
unconfirmableRewardSharesHeight,
disableTransferPrivsTimestamp,
enableTransferPrivsTimestamp,
cancelSellNameValidationTimestamp
cancelSellNameValidationTimestamp,
disableRewardshareHeight
}
// Custom transaction fees
@ -400,7 +401,6 @@ public class BlockChain {
return this.onlineAccountsModulusV2Timestamp;
}
/* Block reward batching */
public long getBlockRewardBatchStartHeight() {
return this.blockRewardBatchStartHeight;
@ -617,6 +617,9 @@ public class BlockChain {
return this.featureTriggers.get(FeatureTrigger.cancelSellNameValidationTimestamp.name()).longValue();
}
public int getDisableRewardshareHeight() {
return this.featureTriggers.get(FeatureTrigger.disableRewardshareHeight.name()).intValue();
}
// More complex getters for aspects that change by height or timestamp
public long getRewardAtHeight(int ourHeight) {

View File

@ -98,6 +98,13 @@ public class RewardShareTransaction extends Transaction {
@Override
public ValidationResult isValid() throws DataException {
final int disableRs = BlockChain.getInstance().getDisableRewardshareHeight();
int blockchainHeight = this.repository.getBlockRepository().getBlockchainHeight();
// Check if reward share is disabled.
if (blockchainHeight >= disableRs)
return ValidationResult.GENERAL_TEMPORARY_DISABLED;
// Check reward share given to recipient. Negative is potentially OK to end a current reward-share. Zero also fine.
if (this.rewardShareTransactionData.getSharePercent() > MAX_SHARE)
return ValidationResult.INVALID_REWARD_SHARE_PERCENT;

View File

@ -249,6 +249,7 @@ public abstract class Transaction {
ACCOUNT_NOT_TRANSFERABLE(99),
TRANSFER_PRIVS_DISABLED(100),
TEMPORARY_DISABLED(101),
GENERAL_TEMPORARY_DISABLED(102),
INVALID_BUT_OK(999),
NOT_YET_RELEASED(1000),
NOT_SUPPORTED(1001);

View File

@ -104,7 +104,8 @@
"unconfirmableRewardSharesHeight": 1575500,
"disableTransferPrivsTimestamp": 1706745000000,
"enableTransferPrivsTimestamp": 1709251200000,
"cancelSellNameValidationTimestamp": 1676986362069
"cancelSellNameValidationTimestamp": 1676986362069,
"disableRewardshareHeight": 9999990
},
"checkpoints": [
{ "height": 1136300, "signature": "3BbwawEF2uN8Ni5ofpJXkukoU8ctAPxYoFB7whq9pKfBnjfZcpfEJT4R95NvBDoTP8WDyWvsUvbfHbcr9qSZuYpSKZjUQTvdFf6eqznHGEwhZApWfvXu6zjGCxYCp65F4jsVYYJjkzbjmkCg5WAwN5voudngA23kMK6PpTNygapCzXt" }

View File

@ -197,3 +197,5 @@ TX_GROUP_ID_MISMATCH = die Gruppen-ID der Transaktion stimmt nicht überein
TRANSFER_PRIVS_DISABLED = Übertragungsberechtigungen deaktiviert
TEMPORARY_DISABLED = Namensregistrierung vorübergehend deaktiviert
GENERAL_TEMPORARY_DISABLED = Vorübergehend deaktiviert

View File

@ -197,3 +197,5 @@ TX_GROUP_ID_MISMATCH = transaction's group ID does not match
TRANSFER_PRIVS_DISABLED = transfer privileges disabled
TEMPORARY_DISABLED = Name registration temporary disabled
GENERAL_TEMPORARY_DISABLED = Temporary disabled

View File

@ -197,3 +197,5 @@ TX_GROUP_ID_MISMATCH = el ID de grupo de la transacción no coincide
TRANSFER_PRIVS_DISABLED = privilegios de transferencia deshabilitados
TEMPORARY_DISABLED = Registro de nombre temporalmente deshabilitado
GENERAL_TEMPORARY_DISABLED = Temporalmente deshabilitado

View File

@ -197,3 +197,5 @@ TX_GROUP_ID_MISMATCH = transaktion ryhmä-ID:n vastaavuusvirhe
TRANSFER_PRIVS_DISABLED = siirtooikeudet poistettu käytöstä
TEMPORARY_DISABLED = Nimen rekisteröinti tilapäisesti poistettu käytöstä
GENERAL_TEMPORARY_DISABLED = Tilapäisesti poistettu käytöstä

View File

@ -197,3 +197,5 @@ TX_GROUP_ID_MISMATCH = l'identifiant du groupe de transaction ne correspond pas
TRANSFER_PRIVS_DISABLED = privilèges de transfert désactivés
TEMPORARY_DISABLED = Enregistrement du nom temporairement désactivé
GENERAL_TEMPORARY_DISABLED = Temporairement désactivé

View File

@ -197,3 +197,5 @@ TX_GROUP_ID_MISMATCH = מזהה הקבוצה של העסקה אינו תואם
TRANSFER_PRIVS_DISABLED = הרשאות העברה מושבתות
TEMPORARY_DISABLED = רישום שמות מושבת זמנית
GENERAL_TEMPORARY_DISABLED = נכה זמנית

View File

@ -197,3 +197,5 @@ TX_GROUP_ID_MISMATCH = a tranzakció csoportazonosítója nem egyezik
TRANSFER_PRIVS_DISABLED = átviteli jogosultságok letiltva
TEMPORARY_DISABLED = A névregisztráció ideiglenesen le van tiltva
GENERAL_TEMPORARY_DISABLED = Ideiglenesen letiltva

View File

@ -197,3 +197,5 @@ TX_GROUP_ID_MISMATCH = identificazione di gruppo della transazione non corrispon
TRANSFER_PRIVS_DISABLED = privilegi di trasferimento disabilitati
TEMPORARY_DISABLED = Registrazione del nome temporaneamente disabilitata
GENERAL_TEMPORARY_DISABLED = Temporaneamente disabilitata

View File

@ -197,3 +197,5 @@ TX_GROUP_ID_MISMATCH = トランザクションのグループIDが一致しま
TRANSFER_PRIVS_DISABLED = 転送権限が無効になっています
TEMPORARY_DISABLED = 名前の登録が一時的に無効になっています
GENERAL_TEMPORARY_DISABLED = 一時的に無効になっています

View File

@ -197,3 +197,5 @@ TX_GROUP_ID_MISMATCH = 트랜잭션의 그룹 ID가 일치하지 않습니다
TRANSFER_PRIVS_DISABLED = 권한 이전이 비활성화되었습니다.
TEMPORARY_DISABLED = 이름 등록이 일시적으로 비활성화되었습니다.
GENERAL_TEMPORARY_DISABLED = 일시적인 장애

View File

@ -197,3 +197,5 @@ TX_GROUP_ID_MISMATCH = groep-ID komt niet overeen
TRANSFER_PRIVS_DISABLED = overdrachtsrechten uitgeschakeld
TEMPORARY_DISABLED = Naamregistratie tijdelijk uitgeschakeld
GENERAL_TEMPORARY_DISABLED = Tijdelijk uitgeschakeld

View File

@ -197,3 +197,5 @@ TX_GROUP_ID_MISMATCH = niezgodność ID grupy transakcji
TRANSFER_PRIVS_DISABLED = uprawnienia do przenoszenia wyłączone
TEMPORARY_DISABLED = Rejestracja nazwy tymczasowo wyłączona
GENERAL_TEMPORARY_DISABLED = Tymczasowo wyłączona

View File

@ -197,3 +197,5 @@ TX_GROUP_ID_MISMATCH = ID-ul de grup al tranzactiei nu se potriveste
TRANSFER_PRIVS_DISABLED = privilegii de transfer dezactivate
TEMPORARY_DISABLED = Înregistrarea numelui a fost temporar dezactivată
GENERAL_TEMPORARY_DISABLED = Temporar dezactivată

View File

@ -197,3 +197,5 @@ TX_GROUP_ID_MISMATCH = не соответствие идентификатор
TRANSFER_PRIVS_DISABLED = права на передачу отключены
TEMPORARY_DISABLED = Регистрация имени временно отключена
GENERAL_TEMPORARY_DISABLED = Временно отключен

View File

@ -197,3 +197,5 @@ TX_GROUP_ID_MISMATCH = transaktionens grupp-ID matchar inte
TRANSFER_PRIVS_DISABLED = överföringsprivilegier inaktiverade
TEMPORARY_DISABLED = Namnregistrering tillfälligt inaktiverad
GENERAL_TEMPORARY_DISABLED = Tillfälligt inaktiverad

View File

@ -197,3 +197,5 @@ TX_GROUP_ID_MISMATCH = 群组ID交易不吻合
TRANSFER_PRIVS_DISABLED = 传输权限已禁用
TEMPORARY_DISABLED = 名称注册暂时禁用
GENERAL_TEMPORARY_DISABLED = 暂时残障

View File

@ -197,3 +197,5 @@ TX_GROUP_ID_MISMATCH = 群組ID交易不吻合
TRANSFER_PRIVS_DISABLED = 傳輸權限已停用
TEMPORARY_DISABLED = 名稱註冊暫時停用
GENERAL_TEMPORARY_DISABLED = 暫時殘障

View File

@ -101,7 +101,8 @@
"unconfirmableRewardSharesHeight": 9999999,
"disableTransferPrivsTimestamp": 9999999999990,
"enableTransferPrivsTimestamp": 9999999999999,
"cancelSellNameValidationTimestamp": 9999999999999
"cancelSellNameValidationTimestamp": 9999999999999,
"disableRewardshareHeight": 9999990
},
"genesisInfo": {
"version": 4,