aboutsummaryrefslogtreecommitdiff
path: root/src/rpc
diff options
context:
space:
mode:
Diffstat (limited to 'src/rpc')
-rw-r--r--src/rpc/core_rpc_server.cpp8
-rw-r--r--src/rpc/daemon_handler.cpp8
2 files changed, 10 insertions, 6 deletions
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp
index c68449630..b5bfb85fa 100644
--- a/src/rpc/core_rpc_server.cpp
+++ b/src/rpc/core_rpc_server.cpp
@@ -526,9 +526,11 @@ namespace cryptonote
res.tx_count = m_core.get_blockchain_storage().get_total_transactions() - res.height; //without coinbase
res.tx_pool_size = m_core.get_pool_transactions_count(!restricted);
res.alt_blocks_count = restricted ? 0 : m_core.get_blockchain_storage().get_alternative_blocks_count();
- uint64_t total_conn = restricted ? 0 : m_p2p.get_public_connections_count();
- res.outgoing_connections_count = restricted ? 0 : m_p2p.get_public_outgoing_connections_count();
- res.incoming_connections_count = restricted ? 0 : (total_conn - res.outgoing_connections_count);
+ // Connection totals are safe, aggregate network-health information for
+ // Monzero's public dashboard. Individual peer addresses remain restricted.
+ uint64_t total_conn = m_p2p.get_public_connections_count();
+ res.outgoing_connections_count = m_p2p.get_public_outgoing_connections_count();
+ res.incoming_connections_count = total_conn - res.outgoing_connections_count;
res.rpc_connections_count = restricted ? 0 : get_connections_count();
res.white_peerlist_size = restricted ? 0 : m_p2p.get_public_white_peers_count();
res.grey_peerlist_size = restricted ? 0 : m_p2p.get_public_gray_peers_count();
diff --git a/src/rpc/daemon_handler.cpp b/src/rpc/daemon_handler.cpp
index add8bca8f..06b1af01f 100644
--- a/src/rpc/daemon_handler.cpp
+++ b/src/rpc/daemon_handler.cpp
@@ -562,9 +562,11 @@ namespace rpc
res.info.alt_blocks_count = m_restricted ? 0 : chain.get_alternative_blocks_count();
- uint64_t total_conn = m_restricted ? 0 : m_p2p.get_public_connections_count();
- res.info.outgoing_connections_count = m_restricted ? 0 : m_p2p.get_public_outgoing_connections_count();
- res.info.incoming_connections_count = m_restricted ? 0 : total_conn - res.info.outgoing_connections_count;
+ // Publish aggregate counts while keeping peer identities unavailable from
+ // restricted RPC.
+ uint64_t total_conn = m_p2p.get_public_connections_count();
+ res.info.outgoing_connections_count = m_p2p.get_public_outgoing_connections_count();
+ res.info.incoming_connections_count = total_conn - res.info.outgoing_connections_count;
res.info.white_peerlist_size = m_restricted ? 0 : m_p2p.get_public_white_peers_count();