File tree Expand file tree Collapse file tree
framework/src/main/java/org/tron/program Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ public class SolidityNode {
3737
3838 private DatabaseGrpcClient databaseGrpcClient ;
3939
40- private AtomicLong ID = new AtomicLong ();
40+ private final AtomicLong ID = new AtomicLong ();
4141
4242 private final AtomicLong remoteBlockNum = new AtomicLong ();
4343
@@ -136,7 +136,7 @@ private void loopProcessBlock(Block block) {
136136 }
137137
138138 private Block getBlockByNum (long blockNum ) {
139- while (true ) {
139+ while (flag ) {
140140 try {
141141 long time = System .currentTimeMillis ();
142142 Block block = databaseGrpcClient .getBlock (blockNum );
@@ -154,10 +154,11 @@ private Block getBlockByNum(long blockNum) {
154154 sleep (exceptionSleepTime );
155155 }
156156 }
157+ throw new RuntimeException ("SolitityNode is closing." );
157158 }
158159
159160 private long getLastSolidityBlockNum () {
160- while (true ) {
161+ while (flag ) {
161162 try {
162163 long time = System .currentTimeMillis ();
163164 long blockNum = databaseGrpcClient .getDynamicProperties ().getLastSolidityBlockNum ();
@@ -170,6 +171,7 @@ private long getLastSolidityBlockNum() {
170171 sleep (exceptionSleepTime );
171172 }
172173 }
174+ throw new RuntimeException ("SolitityNode is closing." );
173175 }
174176
175177 public void sleep (long time ) {
You can’t perform that action at this time.
0 commit comments