limit replies on introset lookup, pick newest

This commit is contained in:
Jeff 2019-02-07 17:48:41 -05:00
parent e623e6fdb5
commit ba8313e57e

View File

@ -80,7 +80,16 @@ namespace llarp
{
handleResult(valuesFound);
}
// get newest introset
if(valuesFound.size() > 1)
{
IntroSet found;
for(const auto & introset : valuesFound)
if(found.OtherIsNewer(introset))
found = introset;
valuesFound.clear();
valuesFound.emplace_back(found);
}
parent->DHTSendTo(whoasked.node.as_array(),
new GotIntroMessage(valuesFound, whoasked.txid));
}