aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/core_rpc_server.cpp
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2019-07-24 14:18:09 -0500
committerluigi1111 <luigi1111w@gmail.com>2019-07-24 14:18:09 -0500
commite241a6280da0785d40e7cda1c474206d711534a0 (patch)
treea73ac8f314cb0e4f562faad823cf992c0de552e3 /src/rpc/core_rpc_server.cpp
parentMerge pull request #5576 (diff)
parentrpc: in/out peers can now return the setting's value (diff)
downloadmonero-e241a6280da0785d40e7cda1c474206d711534a0.tar.xz
Merge pull request #5582
fcfcc3a rpc: in/out peers can now return the setting's value (moneromooo-monero)
Diffstat (limited to 'src/rpc/core_rpc_server.cpp')
-rw-r--r--src/rpc/core_rpc_server.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp
index 6c6b30daa..f41ba6c37 100644
--- a/src/rpc/core_rpc_server.cpp
+++ b/src/rpc/core_rpc_server.cpp
@@ -2095,7 +2095,9 @@ namespace cryptonote
bool core_rpc_server::on_out_peers(const COMMAND_RPC_OUT_PEERS::request& req, COMMAND_RPC_OUT_PEERS::response& res, const connection_context *ctx)
{
PERF_TIMER(on_out_peers);
- m_p2p.change_max_out_public_peers(req.out_peers);
+ if (req.set)
+ m_p2p.change_max_out_public_peers(req.out_peers);
+ res.out_peers = m_p2p.get_max_out_public_peers();
res.status = CORE_RPC_STATUS_OK;
return true;
}
@@ -2103,7 +2105,9 @@ namespace cryptonote
bool core_rpc_server::on_in_peers(const COMMAND_RPC_IN_PEERS::request& req, COMMAND_RPC_IN_PEERS::response& res, const connection_context *ctx)
{
PERF_TIMER(on_in_peers);
- m_p2p.change_max_in_public_peers(req.in_peers);
+ if (req.set)
+ m_p2p.change_max_in_public_peers(req.in_peers);
+ res.in_peers = m_p2p.get_max_in_public_peers();
res.status = CORE_RPC_STATUS_OK;
return true;
}