@@ -91,7 +91,7 @@ public class DynamicPropertiesStore extends TronStoreWithRevoking<BytesCapsule>
91
91
private static final byte [] TOTAL_STORAGE_TAX = "TOTAL_STORAGE_TAX" .getBytes ();
92
92
private static final byte [] TOTAL_STORAGE_RESERVED = "TOTAL_STORAGE_RESERVED" .getBytes ();
93
93
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" ;
95
95
private static final String FORK_PREFIX = "FORK_VERSION_" ;
96
96
//This value is only allowed to be 0, 1, -1
97
97
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>
121
121
private static final byte [] ALLOW_SHIELDED_TRANSACTION = "ALLOW_SHIELDED_TRANSACTION" .getBytes ();
122
122
private static final byte [] ALLOW_SHIELDED_TRC20_TRANSACTION =
123
123
"ALLOW_SHIELDED_TRC20_TRANSACTION"
124
- .getBytes ();
124
+ .getBytes ();
125
125
private static final byte [] ALLOW_TVM_CONSTANTINOPLE = "ALLOW_TVM_CONSTANTINOPLE" .getBytes ();
126
126
private static final byte [] ALLOW_TVM_SOLIDITY_059 = "ALLOW_TVM_SOLIDITY_059" .getBytes ();
127
127
private static final byte [] FORBID_TRANSFER_TO_CONTRACT = "FORBID_TRANSFER_TO_CONTRACT"
@@ -1767,8 +1767,9 @@ public void addTotalTransactionCost(long fee) {
1767
1767
saveTotalTransactionCost (newValue );
1768
1768
}
1769
1769
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 ()));
1772
1773
}
1773
1774
1774
1775
public void statsByVersion (int version , byte [] stats ) {
@@ -1781,9 +1782,10 @@ public byte[] statsByVersion(int version) {
1781
1782
return revokingDB .getUnchecked (statsKey .getBytes ());
1782
1783
}
1783
1784
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 ));
1787
1789
}
1788
1790
1789
1791
/**
@@ -1871,10 +1873,10 @@ private static class DynamicResourceProperties {
1871
1873
private static final byte [] BLOCK_ENERGY_USAGE = "BLOCK_ENERGY_USAGE" .getBytes ();
1872
1874
private static final byte [] ADAPTIVE_RESOURCE_LIMIT_MULTIPLIER =
1873
1875
"ADAPTIVE_RESOURCE_LIMIT_MULTIPLIER"
1874
- .getBytes ();
1876
+ .getBytes ();
1875
1877
private static final byte [] ADAPTIVE_RESOURCE_LIMIT_TARGET_RATIO =
1876
1878
"ADAPTIVE_RESOURCE_LIMIT_TARGET_RATIO"
1877
- .getBytes ();
1879
+ .getBytes ();
1878
1880
}
1879
1881
1880
1882
}
0 commit comments