Merge pull request #6822 from willi123yao/cli-show-syncing

Make syncing message in CLI more intuitive like the GUI
This commit is contained in:
Adam Kelly 2021-06-17 12:47:27 -07:00 committed by GitHub
commit 4b002a4a74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -50,18 +50,14 @@ async def show_async(
total_iters = peak.total_iters if peak is not None else 0
num_blocks: int = 10
if sync_mode:
sync_max_block = blockchain_state["sync"]["sync_tip_height"]
sync_current_block = blockchain_state["sync"]["sync_progress_height"]
print(
"Current Blockchain Status: Full Node syncing to block",
sync_max_block,
"\nCurrently synced to block:",
sync_current_block,
)
if synced:
print("Current Blockchain Status: Full Node Synced")
print("\nPeak: Hash:", peak.header_hash if peak is not None else "")
elif peak is not None and sync_mode:
sync_max_block = blockchain_state["sync"]["sync_tip_height"]
sync_current_block = blockchain_state["sync"]["sync_progress_height"]
print(f"Current Blockchain Status: Syncing {sync_current_block}/{sync_max_block}.")
print("Peak: Hash:", peak.header_hash if peak is not None else "")
elif peak is not None:
print(f"Current Blockchain Status: Not Synced. Peak height: {peak.height}")
else: