more dht tweaks

pull/47/head
Jeff Becker 6 years ago
parent 38a92cb1a8
commit e0f1d985c8
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -292,11 +292,11 @@ namespace llarp
void
NewTX(const TXOwner& askpeer, const TXOwner& whoasked, const K& k,
TX< K, V >* t, bool forceSend = false)
TX< K, V >* t)
{
(void)whoasked;
tx.emplace(askpeer, std::unique_ptr< TX< K, V > >(t));
bool send = waiting.count(k) == 0;
waiting.insert(std::make_pair(k, whoasked));
waiting.insert(std::make_pair(k, askpeer));
auto itr = timeouts.find(k);
if(itr == timeouts.end())
@ -304,8 +304,7 @@ namespace llarp
timeouts.insert(
std::make_pair(k, llarp_time_now_ms() + requestTimeoutMS));
}
if(send || forceSend)
t->Start(askpeer);
t->Start(askpeer);
}
/// mark tx as not fond

@ -593,7 +593,7 @@ namespace llarp
found.insert(remoteTag);
}
// collect our local values if we haven't hit a limit
if(found.size() < 3)
if(found.size() < 2)
{
for(const auto &localTag :
parent->FindRandomIntroSetsWithTagExcluding(target, 1, found))
@ -630,7 +630,7 @@ namespace llarp
LocalTagLookup(const PathID_t &path, uint64_t txid,
const service::Tag &target, Context *ctx)
: TagLookup(TXOwner{ctx->OurKey(), txid}, target, ctx, 3)
: TagLookup(TXOwner{ctx->OurKey(), txid}, target, ctx, 0)
, localPath(path)
{
}
@ -665,9 +665,9 @@ namespace llarp
const llarp::PathID_t &path, const Key_t &askpeer)
{
TXOwner peer(askpeer, ++ids);
TXOwner whoasked(OurKey(), 0);
TXOwner whoasked(OurKey(), txid);
pendingTagLookups.NewTX(peer, whoasked, tag,
new LocalTagLookup(path, txid, tag, this), true);
new LocalTagLookup(path, txid, tag, this));
}
bool

Loading…
Cancel
Save