Skip to content

Commit

Permalink
Merge pull request #272 from XDagger/develop
Browse files Browse the repository at this point in the history
Fix a sync bug
  • Loading branch information
LucasMLK authored Aug 20, 2023
2 parents f28e585 + 1fedeb7 commit 63272ca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/io/xdag/consensus/SyncManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ private void checkState() {
long lastTime = kernel.getSync().getLastTime();
long curTime = msToXdagtimestamp(System.currentTimeMillis());
long curHeight = xdagStats.getNmain();
long maxHeight = xdagStats.getTotalnblocks();
long maxHeight = xdagStats.getTotalnmain();
//Exit the syncOld state based on time and height.
if (!isSync() && (curHeight >= maxHeight - 512 || lastTime >= curTime - 32*REQUEST_BLOCKS_MAX_TIME)) {
log.debug("our node height:{} the max height:{}, set sync state", curHeight, maxHeight);
Expand Down

0 comments on commit 63272ca

Please sign in to comment.