diff options
| author | tobtoht <tob@featherwallet.org> | 2026-06-30 09:55:16 +0000 |
|---|---|---|
| committer | tobtoht <tob@featherwallet.org> | 2026-06-30 09:55:16 +0000 |
| commit | de95c4f993bfd0fc4df07ee7fb6fccbdbe0493ac (patch) | |
| tree | be63930acb0d59c2a6a4d6d12fca77bf82b7b5c4 /src/daemon/rpc_command_executor.cpp | |
| parent | e1cbca2cf588eb767eeb16d74563e40e898c7d08 (diff) | |
| parent | 7c543c82205c3522510e8da616edc795922ce9f3 (diff) | |
| download | monzero-core-de95c4f993bfd0fc4df07ee7fb6fccbdbe0493ac.tar.gz monzero-core-de95c4f993bfd0fc4df07ee7fb6fccbdbe0493ac.tar.xz monzero-core-de95c4f993bfd0fc4df07ee7fb6fccbdbe0493ac.zip | |
Merge pull request #10611
7c543c8 daemon: fix print_cn command when 0 connections (jeffro256)
528cbac Show IPv6 addresses in connection list (Guillaume Le Vaillant)
ACKs: tobtoht, j-berman
Diffstat (limited to 'src/daemon/rpc_command_executor.cpp')
| -rw-r--r-- | src/daemon/rpc_command_executor.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/daemon/rpc_command_executor.cpp b/src/daemon/rpc_command_executor.cpp index f0407eece..f6746b8ad 100644 --- a/src/daemon/rpc_command_executor.cpp +++ b/src/daemon/rpc_command_executor.cpp @@ -644,7 +644,11 @@ bool t_rpc_command_executor::print_connections() { } } - tools::msg_writer() << std::setw(30) << std::left << "Remote Host" + int host_field_width = 15; + for (const auto &conn : res.connections) + host_field_width = std::max(host_field_width, 8 + (int) conn.address.length()); + + tools::msg_writer() << std::setw(host_field_width) << std::left << "Remote Host" << std::setw(8) << "Type" << std::setw(6) << "SSL" << std::setw(20) << "Peer id" @@ -661,11 +665,11 @@ bool t_rpc_command_executor::print_connections() { for (auto & info : res.connections) { std::string address = info.incoming ? "INC " : "OUT "; - address += info.ip + ":" + info.port; + address += info.address; //std::string in_out = info.incoming ? "INC " : "OUT "; tools::msg_writer() //<< std::setw(30) << std::left << in_out - << std::setw(30) << std::left << address + << std::setw(host_field_width) << std::left << address << std::setw(8) << (get_address_type_name((epee::net_utils::address_type)info.address_type)) << std::setw(6) << (info.ssl ? "yes" : "no") << std::setw(20) << info.peer_id |
