mirror of
https://github.com/oxen-io/lokinet.git
synced 2024-11-15 12:13:24 +00:00
Calculate 'candidateNumber' when we should store Introset
This commit is contained in:
parent
37ca564005
commit
d09fd13dd6
@ -134,18 +134,22 @@ namespace llarp
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
bool found = false;
|
int candidateNumber = -1;
|
||||||
|
int index = 0;
|
||||||
for(const auto &rc : closestRCs)
|
for(const auto &rc : closestRCs)
|
||||||
{
|
{
|
||||||
if(rc.pubkey == dht.OurKey())
|
if(rc.pubkey == dht.OurKey())
|
||||||
{
|
{
|
||||||
found = true;
|
candidateNumber = index;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
++index;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(found)
|
if(candidateNumber >= 0)
|
||||||
{
|
{
|
||||||
|
LogInfo("Received PubIntro for ", keyStr, ", txid=", txID,
|
||||||
|
" and we are candidate ", candidateNumber);
|
||||||
dht.services()->PutNode(introset);
|
dht.services()->PutNode(introset);
|
||||||
replies.emplace_back(new GotIntroMessage({introset}, txID));
|
replies.emplace_back(new GotIntroMessage({introset}, txID));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user