From 73fb2f7794028d19b98dd44539f3a67e8df1e866 Mon Sep 17 00:00:00 2001 From: Lee *!* Clagett Date: Wed, 29 Oct 2025 19:44:46 -0400 Subject: [PATCH] Update limits for get_random_outs (#190) --- src/rest_server.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/rest_server.cpp b/src/rest_server.cpp index c6d0c66..a712750 100644 --- a/src/rest_server.cpp +++ b/src/rest_server.cpp @@ -153,6 +153,9 @@ namespace lws //! `/daemon_status` and `get_unspent_outs` caches ZMQ result for this long constexpr const std::chrono::seconds daemon_cache_timeout{5}; + constexpr const unsigned max_ring_size = 20; + constexpr const unsigned max_rings = 150; + struct connection_data { rest_server_data* const global; //!< Valid for lifetime of server @@ -695,7 +698,7 @@ namespace lws using histogram_rpc = cryptonote::rpc::GetOutputHistogram; using distribution_rpc = cryptonote::rpc::GetOutputDistribution; - if (50 < req.count || 20 < req.amounts.values.size()) + if (max_ring_size < req.count || max_rings < req.amounts.values.size()) return {lws::error::exceeded_rest_request_limit}; std::sort(req.amounts.values.begin(), req.amounts.values.end(), std::greater<>{});