Skip to content

Commit 428ede2

Browse files
committed
feat(consensus): optimize block production logic
1 parent e7c8d40 commit 428ede2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

consensus/src/main/java/org/tron/consensus/dpos/DposTask.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ private State produceBlock() {
9191
try {
9292
synchronized (dposService.getBlockHandle().getLock()) {
9393

94+
state = stateManager.getState();
95+
if (!State.OK.equals(state)) {
96+
return state;
97+
}
98+
9499
long slot = dposSlot.getSlot(System.currentTimeMillis() + 50);
95100
if (slot == 0) {
96101
return State.NOT_TIME_YET;

0 commit comments

Comments
 (0)