aboutsummaryrefslogtreecommitdiff
path: root/src/p2p
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-05-28 17:54:41 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-05-30 12:13:31 +0000
commitfcfcc3ac8687a6619d08854a0062ee7d036645fb (patch)
treed9984af5422abd1e02cd53e25ca067f6f0f99931 /src/p2p
parentMerge pull request #5548 (diff)
downloadmonero-fcfcc3ac8687a6619d08854a0062ee7d036645fb.tar.xz
rpc: in/out peers can now return the setting's value
Diffstat (limited to 'src/p2p')
-rw-r--r--src/p2p/net_node.h2
-rw-r--r--src/p2p/net_node.inl18
2 files changed, 20 insertions, 0 deletions
diff --git a/src/p2p/net_node.h b/src/p2p/net_node.h
index 42bb3b061..582b892f4 100644
--- a/src/p2p/net_node.h
+++ b/src/p2p/net_node.h
@@ -245,7 +245,9 @@ namespace nodetool
size_t get_zone_count() const { return m_network_zones.size(); }
void change_max_out_public_peers(size_t count);
+ uint32_t get_max_out_public_peers() const;
void change_max_in_public_peers(size_t count);
+ uint32_t get_max_in_public_peers() const;
virtual bool block_host(const epee::net_utils::network_address &adress, time_t seconds = P2P_IP_BLOCKTIME);
virtual bool unblock_host(const epee::net_utils::network_address &address);
virtual std::map<std::string, time_t> get_blocked_hosts() { CRITICAL_REGION_LOCAL(m_blocked_hosts_lock); return m_blocked_hosts; }
diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl
index ba29d92c9..bf893a231 100644
--- a/src/p2p/net_node.inl
+++ b/src/p2p/net_node.inl
@@ -2217,6 +2217,15 @@ namespace nodetool
}
template<class t_payload_net_handler>
+ uint32_t node_server<t_payload_net_handler>::get_max_out_public_peers() const
+ {
+ const auto public_zone = m_network_zones.find(epee::net_utils::zone::public_);
+ if (public_zone == m_network_zones.end())
+ return 0;
+ return public_zone->second.m_config.m_net_config.max_out_connection_count;
+ }
+
+ template<class t_payload_net_handler>
void node_server<t_payload_net_handler>::change_max_in_public_peers(size_t count)
{
auto public_zone = m_network_zones.find(epee::net_utils::zone::public_);
@@ -2230,6 +2239,15 @@ namespace nodetool
}
template<class t_payload_net_handler>
+ uint32_t node_server<t_payload_net_handler>::get_max_in_public_peers() const
+ {
+ const auto public_zone = m_network_zones.find(epee::net_utils::zone::public_);
+ if (public_zone == m_network_zones.end())
+ return 0;
+ return public_zone->second.m_config.m_net_config.max_in_connection_count;
+ }
+
+ template<class t_payload_net_handler>
bool node_server<t_payload_net_handler>::set_tos_flag(const boost::program_options::variables_map& vm, int flag)
{
if(flag==-1){