aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortobtoht <tob@featherwallet.org>2026-04-29 17:21:41 +0000
committertobtoht <tob@featherwallet.org>2026-04-29 17:21:41 +0000
commited7aba00e0d22aff477dc248fcd78a818b67b0ec (patch)
tree013284131ed45fa1dd441437e1d9f79823272b43 /src
parente38364c07e4921d3cf33cce1eb56aa19478acc34 (diff)
parent0b7c34520c0d218021b7941ebbc2faf0e2b58c2f (diff)
downloadmonzero-core-ed7aba00e0d22aff477dc248fcd78a818b67b0ec.tar.gz
monzero-core-ed7aba00e0d22aff477dc248fcd78a818b67b0ec.tar.xz
monzero-core-ed7aba00e0d22aff477dc248fcd78a818b67b0ec.zip
Merge pull request #10504
0b7c345 daemon: clarify limitations of restricted ZMQ RPC in help text (selsta) f31bb18 zmq: add restricted checks to GetInfo (selsta)
Diffstat (limited to 'src')
-rw-r--r--src/daemon/command_line_args.h2
-rw-r--r--src/rpc/daemon_handler.cpp18
2 files changed, 10 insertions, 10 deletions
diff --git a/src/daemon/command_line_args.h b/src/daemon/command_line_args.h
index 647a7c7b4..a890e92ae 100644
--- a/src/daemon/command_line_args.h
+++ b/src/daemon/command_line_args.h
@@ -138,7 +138,7 @@ namespace daemon_args
const command_line::arg_descriptor<bool> arg_restricted_zmq_rpc = {
"restricted-zmq-rpc"
- , "Restrict ZMQ RPC to view-only / non-sensitive methods"
+ , "Restrict ZMQ RPC by disabling some sensitive methods; does not guarantee filtering of sensitive data"
, false
};
diff --git a/src/rpc/daemon_handler.cpp b/src/rpc/daemon_handler.cpp
index 276682974..10b20282e 100644
--- a/src/rpc/daemon_handler.cpp
+++ b/src/rpc/daemon_handler.cpp
@@ -558,17 +558,17 @@ namespace rpc
res.info.tx_count = chain.get_total_transactions() - res.info.height; //without coinbase
- res.info.tx_pool_size = m_core.get_pool_transactions_count();
+ res.info.tx_pool_size = m_core.get_pool_transactions_count(!m_restricted);
- res.info.alt_blocks_count = chain.get_alternative_blocks_count();
+ res.info.alt_blocks_count = m_restricted ? 0 : chain.get_alternative_blocks_count();
- 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;
+ 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;
- res.info.white_peerlist_size = m_p2p.get_public_white_peers_count();
+ res.info.white_peerlist_size = m_restricted ? 0 : m_p2p.get_public_white_peers_count();
- res.info.grey_peerlist_size = m_p2p.get_public_gray_peers_count();
+ res.info.grey_peerlist_size = m_restricted ? 0 : m_p2p.get_public_gray_peers_count();
res.info.mainnet = m_core.get_nettype() == MAINNET;
res.info.testnet = m_core.get_nettype() == TESTNET;
@@ -578,8 +578,8 @@ namespace rpc
res.info.block_size_limit = res.info.block_weight_limit = m_core.get_blockchain_storage().get_current_cumulative_block_weight_limit();
res.info.block_size_median = res.info.block_weight_median = m_core.get_blockchain_storage().get_current_cumulative_block_weight_median();
res.info.adjusted_time = m_core.get_blockchain_storage().get_adjusted_time(res.info.height);
- res.info.start_time = (uint64_t)m_core.get_start_time();
- res.info.version = MONERO_VERSION;
+ res.info.start_time = m_restricted ? 0 : (uint64_t)m_core.get_start_time();
+ res.info.version = m_restricted ? "" : MONERO_VERSION;
res.status = Message::STATUS_OK;
res.error_details = "";