mirror of
https://github.com/oxen-io/lokinet
synced 2023-12-14 06:53:00 +01:00
explicit not found for non staked nodes
This commit is contained in:
parent
8853e1d3d8
commit
15fd9c1bef
|
@ -35,6 +35,12 @@ namespace llarp
|
||||||
Key_t peer;
|
Key_t peer;
|
||||||
// check if we know this in our nodedb first
|
// check if we know this in our nodedb first
|
||||||
RouterContact found;
|
RouterContact found;
|
||||||
|
if(!dht.GetRouter()->ConnectionToRouterAllowed(K))
|
||||||
|
{
|
||||||
|
// explicitly disallowed by network
|
||||||
|
replies.emplace_back(new GotRouterMessage(k, txid, {}, false));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
if(dht.GetRouter()->nodedb()->Get(K, found))
|
if(dht.GetRouter()->nodedb()->Get(K, found))
|
||||||
{
|
{
|
||||||
replies.emplace_back(new GotRouterMessage(k, txid, {found}, false));
|
replies.emplace_back(new GotRouterMessage(k, txid, {found}, false));
|
||||||
|
@ -166,6 +172,12 @@ namespace llarp
|
||||||
Key_t k{K};
|
Key_t k{K};
|
||||||
if(exploritory)
|
if(exploritory)
|
||||||
return dht.HandleExploritoryRouterLookup(From, txid, K, replies);
|
return dht.HandleExploritoryRouterLookup(From, txid, K, replies);
|
||||||
|
else if(!dht.GetRouter()->ConnectionToRouterAllowed(K))
|
||||||
|
{
|
||||||
|
// explicitly disallowed by network
|
||||||
|
replies.emplace_back(new GotRouterMessage(k, txid, {}, false));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
else if(dht.Nodes()->HasNode(k))
|
else if(dht.Nodes()->HasNode(k))
|
||||||
{
|
{
|
||||||
found = dht.Nodes()->nodes[k].rc;
|
found = dht.Nodes()->nodes[k].rc;
|
||||||
|
|
Loading…
Reference in a new issue