From 977928607cd5d35a9cbf818147cd95e17b3debf3 Mon Sep 17 00:00:00 2001 From: Gene Hoffman <30377676+hoffmang9@users.noreply.github.com> Date: Fri, 30 Apr 2021 10:19:34 -0700 Subject: [PATCH] Update CLI tools to use EiB when appropriate. (#3117) --- chia/cmds/netspace_funcs.py | 9 +++++++-- chia/cmds/show.py | 6 +++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/chia/cmds/netspace_funcs.py b/chia/cmds/netspace_funcs.py index 7705dba1ff..4ee713c9e5 100644 --- a/chia/cmds/netspace_funcs.py +++ b/chia/cmds/netspace_funcs.py @@ -60,8 +60,13 @@ async def netstorge_async(rpc_port: int, delta_block_height: str, start: str) -> f"Header Hash: 0x{newer_block_header.header_hash}\n" ) network_space_terabytes_estimate = network_space_bytes_estimate / 1024 ** 4 - if network_space_terabytes_estimate > 1024: - print(f"The network has an estimated {network_space_terabytes_estimate / 1024:.3f} PiB") + if network_space_terabytes_estimate >= 1024: + network_space_terabytes_estimate = network_space_terabytes_estimate / 1024 + if network_space_terabytes_estimate >= 1024: + network_space_terabytes_estimate = network_space_terabytes_estimate / 1024 + print(f"The network has an estimated {network_space_terabytes_estimate:.3f} EiB") + else: + print(f"The network has an estimated {network_space_terabytes_estimate:.3f} PiB") else: print(f"The network has an estimated {network_space_terabytes_estimate:.3f} TiB") diff --git a/chia/cmds/show.py b/chia/cmds/show.py index e2a89082cb..4ba00c14ad 100644 --- a/chia/cmds/show.py +++ b/chia/cmds/show.py @@ -88,7 +88,11 @@ async def show_async( network_space_human_readable = blockchain_state["space"] / 1024 ** 4 if network_space_human_readable >= 1024: network_space_human_readable = network_space_human_readable / 1024 - print(f"{network_space_human_readable:.3f} PiB") + if network_space_human_readable >= 1024: + network_space_human_readable = network_space_human_readable / 1024 + print(f"{network_space_human_readable:.3f} EiB") + else: + print(f"{network_space_human_readable:.3f} PiB") else: print(f"{network_space_human_readable:.3f} TiB") print(f"Current difficulty: {difficulty}")