1
1
Fork 0
mirror of https://github.com/oxen-io/lokinet synced 2023-12-14 06:53:00 +01:00

check for address

This commit is contained in:
Jeff 2018-10-23 14:18:00 -04:00
parent 5997960f70
commit f35f34ede4
3 changed files with 12 additions and 1 deletions

View file

@ -84,6 +84,12 @@ namespace llarp
service::Address
ObtainAddrForIP(huint32_t ip);
bool
HasAddress(const Address& remote)
{
return m_AddrToIP.find(remote) != m_AddrToIP.end();
}
protected:
typedef llarp::util::CoDelQueue<
net::IPv4Packet, net::IPv4Packet::GetTime, net::IPv4Packet::PutTime,

View file

@ -112,6 +112,11 @@ namespace llarp
return {0};
}
virtual bool
HasAddress(const Address& remote) const
{
return false;
}
/// return true if we have a pending job to build to a hidden service but
/// it's not done yet
bool

View file

@ -104,7 +104,7 @@ namespace llarp
auto itr = m_Endpoints.begin();
while(itr != m_Endpoints.end())
{
if(itr->second->HasPathToService(addr))
if(itr->second->HasAddress(addr))
{
return itr->second->ObtainIPForAddr(addr);
}