Update CLI tools to use EiB when appropriate. (#3117)

This commit is contained in:
Gene Hoffman
2021-04-30 10:19:34 -07:00
committed by GitHub
parent c75bf4b2f4
commit 977928607c
2 changed files with 12 additions and 3 deletions
+7 -2
View File
@@ -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")
+5 -1
View File
@@ -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}")