diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2020-11-07 00:17:47 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2020-11-07 00:17:47 +0000 |
commit | 44c93bb47a2d25761b610da586c76fd835b35c65 (patch) | |
tree | 9105d8ddc1e26b8f697ad79a4031e9a88ecb6c7c /src/p2p/net_node.inl | |
parent | Merge pull request #6990 (diff) | |
download | monero-44c93bb47a2d25761b610da586c76fd835b35c65.tar.xz |
p2p: fix accessing non existent element of map
Diffstat (limited to 'src/p2p/net_node.inl')
-rw-r--r-- | src/p2p/net_node.inl | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl index 1eb32a087..96b048119 100644 --- a/src/p2p/net_node.inl +++ b/src/p2p/net_node.inl @@ -1299,7 +1299,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; |