aboutsummaryrefslogtreecommitdiff
path: root/src/p2p/net_node.inl
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-11-29 16:21:33 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-12-01 23:52:16 +0000
commit4adde0423bcf835418857ae496e34b45f318bba2 (patch)
tree6250260a94c0dd90ce6c3b9d6c9796f3e60e3a7a /src/p2p/net_node.inl
parentMerge pull request #1372 (diff)
downloadmonero-4adde0423bcf835418857ae496e34b45f318bba2.tar.xz
p2p: possibly fix crash in relay_blocks
Diffstat (limited to 'src/p2p/net_node.inl')
-rw-r--r--src/p2p/net_node.inl17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl
index b5bfc2979..5efd6da13 100644
--- a/src/p2p/net_node.inl
+++ b/src/p2p/net_node.inl
@@ -1242,6 +1242,16 @@ namespace nodetool
}
//-----------------------------------------------------------------------------------
template<class t_payload_net_handler>
+ bool node_server<t_payload_net_handler>::relay_notify_to_list(int command, const std::string& data_buff, const std::list<boost::uuids::uuid> &connections)
+ {
+ BOOST_FOREACH(const auto& c_id, connections)
+ {
+ m_net_server.get_config_object().notify(command, data_buff, c_id);
+ }
+ return true;
+ }
+ //-----------------------------------------------------------------------------------
+ template<class t_payload_net_handler>
bool node_server<t_payload_net_handler>::relay_notify_to_all(int command, const std::string& data_buff, const epee::net_utils::connection_context_base& context)
{
std::list<boost::uuids::uuid> connections;
@@ -1251,12 +1261,7 @@ namespace nodetool
connections.push_back(cntxt.m_connection_id);
return true;
});
-
- BOOST_FOREACH(const auto& c_id, connections)
- {
- m_net_server.get_config_object().notify(command, data_buff, c_id);
- }
- return true;
+ return relay_notify_to_list(command, data_buff, connections);
}
//-----------------------------------------------------------------------------------
template<class t_payload_net_handler>