@@ -91,7 +91,7 @@ public class DynamicPropertiesStore extends TronStoreWithRevoking<BytesCapsule>
9191 private static final byte [] TOTAL_STORAGE_TAX = "TOTAL_STORAGE_TAX" .getBytes ();
9292 private static final byte [] TOTAL_STORAGE_RESERVED = "TOTAL_STORAGE_RESERVED" .getBytes ();
9393 private static final byte [] STORAGE_EXCHANGE_TAX_RATE = "STORAGE_EXCHANGE_TAX_RATE" .getBytes ();
94- private static final byte [] FORK_CONTROLLER = "FORK_CONTROLLER" . getBytes () ;
94+ private static final String FORK_CONTROLLER = "FORK_CONTROLLER" ;
9595 private static final String FORK_PREFIX = "FORK_VERSION_" ;
9696 //This value is only allowed to be 0, 1, -1
9797 private static final byte [] REMOVE_THE_POWER_OF_THE_GR = "REMOVE_THE_POWER_OF_THE_GR" .getBytes ();
@@ -121,7 +121,7 @@ public class DynamicPropertiesStore extends TronStoreWithRevoking<BytesCapsule>
121121 private static final byte [] ALLOW_SHIELDED_TRANSACTION = "ALLOW_SHIELDED_TRANSACTION" .getBytes ();
122122 private static final byte [] ALLOW_SHIELDED_TRC20_TRANSACTION =
123123 "ALLOW_SHIELDED_TRC20_TRANSACTION"
124- .getBytes ();
124+ .getBytes ();
125125 private static final byte [] ALLOW_TVM_CONSTANTINOPLE = "ALLOW_TVM_CONSTANTINOPLE" .getBytes ();
126126 private static final byte [] ALLOW_TVM_SOLIDITY_059 = "ALLOW_TVM_SOLIDITY_059" .getBytes ();
127127 private static final byte [] FORBID_TRANSFER_TO_CONTRACT = "FORBID_TRANSFER_TO_CONTRACT"
@@ -1767,8 +1767,9 @@ public void addTotalTransactionCost(long fee) {
17671767 saveTotalTransactionCost (newValue );
17681768 }
17691769
1770- public void forked () {
1771- put (FORK_CONTROLLER , new BytesCapsule (Boolean .toString (true ).getBytes ()));
1770+ public void forked (int version , boolean value ) {
1771+ String forkKey = FORK_CONTROLLER + version ;
1772+ put (forkKey .getBytes (), new BytesCapsule (Boolean .toString (value ).getBytes ()));
17721773 }
17731774
17741775 public void statsByVersion (int version , byte [] stats ) {
@@ -1781,9 +1782,10 @@ public byte[] statsByVersion(int version) {
17811782 return revokingDB .getUnchecked (statsKey .getBytes ());
17821783 }
17831784
1784- public boolean getForked () {
1785- byte [] value = revokingDB .getUnchecked (FORK_CONTROLLER );
1786- return value == null ? Boolean .FALSE : Boolean .valueOf (new String (value ));
1785+ public Boolean getForked (int version ) {
1786+ String forkKey = FORK_CONTROLLER + version ;
1787+ byte [] value = revokingDB .getUnchecked (forkKey .getBytes ());
1788+ return value == null ? null : Boolean .valueOf (new String (value ));
17871789 }
17881790
17891791 /**
@@ -1871,10 +1873,10 @@ private static class DynamicResourceProperties {
18711873 private static final byte [] BLOCK_ENERGY_USAGE = "BLOCK_ENERGY_USAGE" .getBytes ();
18721874 private static final byte [] ADAPTIVE_RESOURCE_LIMIT_MULTIPLIER =
18731875 "ADAPTIVE_RESOURCE_LIMIT_MULTIPLIER"
1874- .getBytes ();
1876+ .getBytes ();
18751877 private static final byte [] ADAPTIVE_RESOURCE_LIMIT_TARGET_RATIO =
18761878 "ADAPTIVE_RESOURCE_LIMIT_TARGET_RATIO"
1877- .getBytes ();
1879+ .getBytes ();
18781880 }
18791881
18801882}
0 commit comments