explicit not found for non staked nodes

This commit is contained in:
Jeff Becker 2019-05-09 08:38:21 -04:00
parent 8853e1d3d8
commit 15fd9c1bef
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05
1 changed files with 12 additions and 0 deletions

View File

@ -35,6 +35,12 @@ namespace llarp
Key_t peer;
// check if we know this in our nodedb first
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))
{
replies.emplace_back(new GotRouterMessage(k, txid, {found}, false));
@ -166,6 +172,12 @@ namespace llarp
Key_t k{K};
if(exploritory)
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))
{
found = dht.Nodes()->nodes[k].rc;