Skip to content

Commit 05c813d

Browse files
Don't allow activations to change live block once feature is live
1 parent 14048de commit 05c813d

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/omnicore/rules.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,18 +483,34 @@ bool ActivateFeature(uint16_t featureId, int activationBlock, uint32_t minClient
483483
bool supported = OMNICORE_VERSION >= minClientVersion;
484484
switch (featureId) {
485485
case FEATURE_CLASS_C:
486+
if (params.NULLDATA_BLOCK <= transactionBlock) {
487+
PrintToLog("Feature activation of ID %d refused as the feature is already live\n", featureId);
488+
return false;
489+
}
486490
MutableConsensusParams().NULLDATA_BLOCK = activationBlock;
487491
featureName = "Class C transaction encoding";
488492
break;
489493
case FEATURE_METADEX:
494+
if (params.MSC_METADEX_BLOCK <= transactionBlock) {
495+
PrintToLog("Feature activation of ID %d refused as the feature is already live\n", featureId);
496+
return false;
497+
}
490498
MutableConsensusParams().MSC_METADEX_BLOCK = activationBlock;
491499
featureName = "Distributed Meta Token Exchange";
492500
break;
493501
case FEATURE_BETTING:
502+
if (params.MSC_BET_BLOCK <= transactionBlock) {
503+
PrintToLog("Feature activation of ID %d refused as the feature is already live\n", featureId);
504+
return false;
505+
}
494506
MutableConsensusParams().MSC_BET_BLOCK = activationBlock;
495507
featureName = "Bet transactions";
496508
break;
497509
case FEATURE_GRANTEFFECTS:
510+
if (params.GRANTEFFECTS_FEATURE_BLOCK <= transactionBlock) {
511+
PrintToLog("Feature activation of ID %d refused as the feature is already live\n", featureId);
512+
return false;
513+
}
498514
MutableConsensusParams().GRANTEFFECTS_FEATURE_BLOCK = activationBlock;
499515
featureName = "Remove grant side effects";
500516
break;

0 commit comments

Comments
 (0)