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:
parent
5997960f70
commit
f35f34ede4
3 changed files with 12 additions and 1 deletions
|
@ -84,6 +84,12 @@ namespace llarp
|
||||||
service::Address
|
service::Address
|
||||||
ObtainAddrForIP(huint32_t ip);
|
ObtainAddrForIP(huint32_t ip);
|
||||||
|
|
||||||
|
bool
|
||||||
|
HasAddress(const Address& remote)
|
||||||
|
{
|
||||||
|
return m_AddrToIP.find(remote) != m_AddrToIP.end();
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
typedef llarp::util::CoDelQueue<
|
typedef llarp::util::CoDelQueue<
|
||||||
net::IPv4Packet, net::IPv4Packet::GetTime, net::IPv4Packet::PutTime,
|
net::IPv4Packet, net::IPv4Packet::GetTime, net::IPv4Packet::PutTime,
|
||||||
|
|
|
@ -112,6 +112,11 @@ namespace llarp
|
||||||
return {0};
|
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
|
/// return true if we have a pending job to build to a hidden service but
|
||||||
/// it's not done yet
|
/// it's not done yet
|
||||||
bool
|
bool
|
||||||
|
|
|
@ -104,7 +104,7 @@ namespace llarp
|
||||||
auto itr = m_Endpoints.begin();
|
auto itr = m_Endpoints.begin();
|
||||||
while(itr != m_Endpoints.end())
|
while(itr != m_Endpoints.end())
|
||||||
{
|
{
|
||||||
if(itr->second->HasPathToService(addr))
|
if(itr->second->HasAddress(addr))
|
||||||
{
|
{
|
||||||
return itr->second->ObtainIPForAddr(addr);
|
return itr->second->ObtainIPForAddr(addr);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue