mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 21:37:17 +01:00
don't accept our own RouterInfo
This commit is contained in:
parent
0493f00a7a
commit
eab08ea78c
|
@ -450,6 +450,12 @@ namespace data
|
||||||
}
|
}
|
||||||
offset += 32;
|
offset += 32;
|
||||||
}
|
}
|
||||||
|
// we must send reply back before this check
|
||||||
|
if (ident == i2p::context.GetIdentHash ())
|
||||||
|
{
|
||||||
|
LogPrint (eLogError, "NetDb: database store with own RouterInfo received, dropped");
|
||||||
|
return;
|
||||||
|
}
|
||||||
size_t payloadOffset = offset;
|
size_t payloadOffset = offset;
|
||||||
|
|
||||||
bool updated = false;
|
bool updated = false;
|
||||||
|
@ -489,6 +495,7 @@ namespace data
|
||||||
floodMsg->FillI2NPMessageHeader (eI2NPDatabaseStore);
|
floodMsg->FillI2NPMessageHeader (eI2NPDatabaseStore);
|
||||||
std::set<IdentHash> excluded;
|
std::set<IdentHash> excluded;
|
||||||
excluded.insert (i2p::context.GetIdentHash ()); // don't flood to itself
|
excluded.insert (i2p::context.GetIdentHash ()); // don't flood to itself
|
||||||
|
excluded.insert (ident); // don't flood back
|
||||||
for (int i = 0; i < 3; i++)
|
for (int i = 0; i < 3; i++)
|
||||||
{
|
{
|
||||||
auto floodfill = GetClosestFloodfill (ident, excluded);
|
auto floodfill = GetClosestFloodfill (ident, excluded);
|
||||||
|
|
Loading…
Reference in a new issue