Skip to content

Commit

Permalink
fix loop
Browse files Browse the repository at this point in the history
  • Loading branch information
Qi Zhou committed Jan 22, 2025
1 parent 652d070 commit 865b7e6
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions quarkchain/cluster/master.py
Original file line number Diff line number Diff line change
Expand Up @@ -948,8 +948,8 @@ def log_error_and_exit(msg):

start_time = time.monotonic()
# Start with root db
check_db_rblock_from = self.env.arguments.check_db_rblock_from # highest height
check_db_rblock_to = self.env.arguments.check_db_rblock_to # lowest height
check_db_rblock_from = self.env.arguments.check_db_rblock_from # highest height (inclusive)
check_db_rblock_to = self.env.arguments.check_db_rblock_to # lowest height (exclusive)
rb = self.root_state.get_root_block_by_height(check_db_rblock_to)
Logger.info(
"Starting from root block height: {0}, batch size: {1}, to block height: {2}".format(
Expand All @@ -963,14 +963,12 @@ def log_error_and_exit(msg):
)
)
count = 0
while rb.header.height <= check_db_rblock_from:
while rb.header.height < check_db_rblock_from:
if count % 100 == 0:
Logger.info("Checking root block height: {}".format(rb.header.height))
rb_list = []
for i in range(self.env.arguments.check_db_rblock_batch):
count += 1
rb_list.append(rb)

if rb.header.height >= check_db_rblock_from:
break

Expand All @@ -995,6 +993,7 @@ def log_error_and_exit(msg):
rb.header.height
)
)
rb_list.append(rb)

future_list = []
header_list = []
Expand Down

0 comments on commit 865b7e6

Please sign in to comment.