mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
don't request same RouterInfo twice
This commit is contained in:
parent
4a6847da8d
commit
cd8e9e59fa
2 changed files with 11 additions and 1 deletions
11
NetDb.cpp
11
NetDb.cpp
|
@ -455,7 +455,16 @@ namespace data
|
|||
// request RouterInfo directly
|
||||
RequestedDestination * dest = CreateRequestedDestination (destination, false);
|
||||
if (requestComplete)
|
||||
dest->SetRequestComplete (requestComplete);
|
||||
{
|
||||
if (dest->IsRequestComplete ()) // if set already
|
||||
{
|
||||
LogPrint (eLogWarning, "Destination ", destination.ToBase64(), " is requested already");
|
||||
requestComplete (nullptr); // TODO: implement it better
|
||||
return;
|
||||
}
|
||||
else
|
||||
dest->SetRequestComplete (requestComplete);
|
||||
}
|
||||
auto floodfill = GetClosestFloodfill (destination, dest->GetExcludedPeers ());
|
||||
if (floodfill)
|
||||
transports.SendMessage (floodfill->GetIdentHash (), dest->CreateRequestMessage (floodfill->GetIdentHash ()));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue