Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions framework/src/main/java/org/tron/program/SolidityNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,15 @@ private void getBlock() {
Block block = getBlockByNum(blockNum);
blockQueue.put(block);
blockNum = ID.incrementAndGet();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
logger.info("getBlock interrupted, exiting.");
return;
} catch (Exception e) {
if (!flag) {
logger.info("getBlock stopped during shutdown, last block: {}.", blockNum);
return;
}
logger.error("Failed to get block {}, reason: {}.", blockNum, e.getMessage());
sleep(exceptionSleepTime);
}
Expand Down Expand Up @@ -194,6 +202,10 @@ private long getLastSolidityBlockNum() {
blockNum, remoteBlockNum, System.currentTimeMillis() - time);
return blockNum;
} catch (Exception e) {
if (!flag) {
logger.info("getLastSolidityBlockNum stopped during shutdown.");
return 0;
}
logger.error("Failed to get last solid blockNum: {}, reason: {}.", remoteBlockNum.get(),
e.getMessage());
sleep(exceptionSleepTime);
Expand All @@ -205,8 +217,8 @@ private long getLastSolidityBlockNum() {
public void sleep(long time) {
try {
Thread.sleep(time);
} catch (Exception e1) {
logger.error(e1.getMessage());
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
}

Expand Down
Loading
Loading