aboutsummaryrefslogtreecommitdiff
path: root/src/p2p
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2020-11-06 18:53:22 -0600
committerluigi1111 <luigi1111w@gmail.com>2020-11-06 18:53:22 -0600
commit1a3bef15b9b881e62748bc50a58f346d4b284af1 (patch)
treed95c68399e6cc0af1c3f524d845f8df6001acdd1 /src/p2p
parentMerge pull request #6992 (diff)
parentp2p: fix accessing non existent element of map (diff)
downloadmonero-1a3bef15b9b881e62748bc50a58f346d4b284af1.tar.xz
Merge pull request #6993v0.17.1.2
44c93bb p2p: fix accessing non existent element of map (moneromooo-monero)
Diffstat (limited to 'src/p2p')
-rw-r--r--src/p2p/net_node.inl5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl
index 80fe2828a..23ac7bdf0 100644
--- a/src/p2p/net_node.inl
+++ b/src/p2p/net_node.inl
@@ -1300,7 +1300,10 @@ namespace nodetool
template<class t_payload_net_handler>
bool node_server<t_payload_net_handler>::try_to_connect_and_handshake_with_new_peer(const epee::net_utils::network_address& na, bool just_take_peerlist, uint64_t last_seen_stamp, PeerType peer_type, uint64_t first_seen_stamp)
{
- network_zone& zone = m_network_zones.at(na.get_zone());
+ const auto i = m_network_zones.find(na.get_zone());
+ if (i == m_network_zones.end())
+ return false;
+ network_zone& zone = i->second;
if (zone.m_connect == nullptr) // outgoing connections in zone not possible
return false;