idk what is going on

pull/66/head
Jeff Becker 6 years ago
parent 9baf6ecfd9
commit 937ab151ab
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -76,6 +76,9 @@ namespace llarp
bool
Start();
bool
HasLocalMappedAddrFor(const llarp::PubKey& pk) const;
huint32_t
GetIfAddr() const;

@ -99,11 +99,17 @@ namespace llarp
return m_IfAddr;
}
bool
ExitEndpoint::HasLocalMappedAddrFor(const llarp::PubKey &pk) const
{
return m_KeyToIP.find(pk) != m_KeyToIP.end();
}
huint32_t
ExitEndpoint::GetIPForIdent(const llarp::PubKey pk)
{
huint32_t found = {0};
if(m_KeyToIP.count(pk) == 0)
if(!HasLocalMappedAddrFor(pk))
{
// allocate and map
found = AllocateNewAddress();
@ -117,7 +123,7 @@ namespace llarp
llarp::LogError(Name(), "failed to map ", found, " to ", pk);
return found;
}
if(m_KeyToIP.count(pk))
if(HasLocalMappedAddrFor(pk))
llarp::LogInfo(Name(), " mapping ", pk, " to ", found);
else
llarp::LogError(Name(), "failed to map ", pk, " to ", found);

Loading…
Cancel
Save