Calculate 'candidateNumber' when we should store Introset

pull/1147/head
Stephen Shelton 5 years ago
parent 37ca564005
commit d09fd13dd6
No known key found for this signature in database
GPG Key ID: EE4BADACCE8B631C

@ -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…
Cancel
Save