Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions flora/cmds/show.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,10 @@ async def show_async(
connections = await client.get_connections()
print("Connections:")
print(
"Type IP Ports NodeID Last Connect"
+ " MiB Up|Dwn"
"Type IP Ports NodeID Last Connect"
+ " MiB Up|Dwn SB Height Hash"


)
for con in connections:
last_connect_tuple = struct_time(localtime(con["last_message_time"]))
Expand All @@ -129,23 +131,23 @@ async def show_async(
if peak_height is None:
peak_height = 0
con_str = (
f"{NodeType(con['type']).name:9} {host:38} "
f"{NodeType(con['type']).name:13} {host:20} "
f"{con['peer_port']:5}/{con['peer_server_port']:<5}"
f" {con['node_id'].hex()[:8]}... "
f"{last_connect} "
f"{mb_up:7.1f}|{mb_down:<7.1f}"
f"\n "
f"-SB Height: {peak_height:8.0f} -Hash: {peak_hash[2:10]}..."
f"{peak_height:8.0f} {peak_hash[2:10]}..."
)
else:
con_str = (
f"{NodeType(con['type']).name:9} {host:38} "
f"{NodeType(con['type']).name:13} {host:20} "
f"{con['peer_port']:5}/{con['peer_server_port']:<5}"
f" {con['node_id'].hex()[:8]}... "
f"{last_connect} "
f"{mb_up:7.1f}|{mb_down:<7.1f}"
)
print(con_str)

# if called together with state, leave a blank line
if state:
print("")
Expand Down