diff --git a/llarp/handlers/exit.cpp b/llarp/handlers/exit.cpp index 982ba9faf..2361eced5 100644 --- a/llarp/handlers/exit.cpp +++ b/llarp/handlers/exit.cpp @@ -102,9 +102,8 @@ namespace llarp huint32_t ExitEndpoint::GetIPForIdent(const llarp::PubKey pk) { - huint32_t found = {0}; - KeyMap_t::iterator itr = m_KeyToIP.find(pk); - if(itr == m_KeyToIP.end()) + huint32_t found = {0}; + if(m_KeyToIP.count(pk) == 0) { // allocate and map found = AllocateNewAddress(); @@ -124,7 +123,7 @@ namespace llarp llarp::LogError(Name(), "failed to map ", pk, " to ", found); } else - found.h = itr->second.h; + found.h = m_KeyToIP[pk].h; MarkIPActive(found);