Skip to content

Commit 2751a7c

Browse files
committed
fix solidity do not sync
1 parent 223777c commit 2751a7c

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/main/java/org/tron/common/utils/ForkController.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import org.apache.commons.lang3.StringUtils;
1818
import org.tron.core.Wallet;
1919
import org.tron.core.capsule.BlockCapsule;
20+
import org.tron.core.config.Parameter;
2021
import org.tron.core.config.Parameter.ForkBlockVersionConsts;
2122
import org.tron.core.db.Manager;
2223

@@ -41,6 +42,10 @@ public void init(Manager manager) {
4142
}
4243

4344
public synchronized boolean pass(int version) {
45+
if (!check(version)) {
46+
return false;
47+
}
48+
4449
if (passSet.contains(version)) {
4550
return true;
4651
}
@@ -53,6 +58,15 @@ public synchronized boolean pass(int version) {
5358
return pass;
5459
}
5560

61+
private boolean check(int version) {
62+
if (version != ForkBlockVersionConsts.ENERGY_LIMIT) {
63+
return true;
64+
}
65+
66+
long blockNum = manager.getDynamicPropertiesStore().getLatestBlockHeaderNumber();
67+
return blockNum >= 4727890L;
68+
}
69+
5670
private boolean check(byte[] stats) {
5771
if (stats == null || stats.length == 0) {
5872
return false;

0 commit comments

Comments
 (0)