File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
src/main/java/org/tron/common/utils Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 17
17
import org .apache .commons .lang3 .StringUtils ;
18
18
import org .tron .core .Wallet ;
19
19
import org .tron .core .capsule .BlockCapsule ;
20
+ import org .tron .core .config .Parameter ;
20
21
import org .tron .core .config .Parameter .ForkBlockVersionConsts ;
21
22
import org .tron .core .db .Manager ;
22
23
@@ -41,6 +42,10 @@ public void init(Manager manager) {
41
42
}
42
43
43
44
public synchronized boolean pass (int version ) {
45
+ if (!check (version )) {
46
+ return false ;
47
+ }
48
+
44
49
if (passSet .contains (version )) {
45
50
return true ;
46
51
}
@@ -53,6 +58,15 @@ public synchronized boolean pass(int version) {
53
58
return pass ;
54
59
}
55
60
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
+
56
70
private boolean check (byte [] stats ) {
57
71
if (stats == null || stats .length == 0 ) {
58
72
return false ;
You can’t perform that action at this time.
0 commit comments